2023CSS 背景大小属性

 所属分类:web前端开发

 浏览:54次-  评论: 0次-  更新时间:2023-10-02
描述:更多教程资料进入php教程获得。 CSS的background-size属性用于指定背景图像的大小。示例您可以尝试运行以下代码来实现背景 - CSS ...
更多教程资料进入php教程获得。

CSS 背景大小属性

CSS的background-size属性用于指定背景图像的大小。

示例

您可以尝试运行以下代码来实现背景 - CSS 中的 size 属性:

现场演示

<html>
   <head>

      <style>
         #demo {
            border: 5px dashed green;
            padding: 10px;
            background-image: url("https://img.zzsucai.com/202310/02/hxWYW47904080711.jpg");
            background-size: 200px 100px;
         }
      </style>

   </head>

   <body>
      <div id="demo">
         <h1>www.tutorialspoint.com</h1>
         <p>The website www.tutorialspoint.com is owned and maintained by Tutorials Point India Private Limited,
            henceforth termed as “we”, “our”, “us”, or the “company”. All the visitors, users, learners, contributors,
            teachers, and instructors are named as "users"; and the website tutorialspoint.com is termed as "website" everywhere in this document.
            We are committed to protecting your privacy online. This privacy policy explains what information we collect from you
            or what information you share with us when you visit the website. We review our policy from time to time, so you are advised to check the latest version.</p>
      </div>

   </body>
</html>
 标签:
积分说明:注册即送10金币,每日签到可获得更多金币,成为VIP会员可免金币下载! 充值积分充值会员更多说明»

讨论这个素材(0)回答他人问题或分享使用心得奖励金币

〒_〒 居然一个评论都没有……

表情  文明上网,理性发言!