a background sample

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
          margin: 0px;
          padding: 0px;
      }
      div.box{
          width: 300px;
          height: 300px;
          border:10px double red;
          padding:10px;
          / * Set the background image * /
         background-image:url("./source/img/1.jpg");
         / * Set the background color * /
         background-color:aqua;
         / * Set the background image size * /
         background-size:100px auto;
         / * Set whether to repeat the background image * /
         background-repeat: no-repeat;
         / * Set the background image x-axis position of the two parameters y-axis * /
         background-position: 10px 0px;
         / * Start from the origin is calculated at the margins * /
         background-origin:padding-box;
         / * Set the background range * /
         background-clip:content-box;
         
      }
    </style>
  </head>
  <body>
    <div class="box"></div>
  </body>
</html>

Guess you like

Origin www.cnblogs.com/kukai/p/12307639.html