xuanjiange

HTML

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>背景图片拉伸铺满页面</title>
        <link type="text/css" rel="stylesheet" href="img.css"/>
    </head>
    <body>
    </body>
</html>

CSS(图片不拉伸)

body{
    background-image: url(../../img/002.jpg);
    background-size: cover;
  /*是否重复*/
background-repeat: no-repeat; }

 CSS(图片拉伸)

body{
    background-image: url(../../img/002.jpg);
    background-size: 100% 100%;
  /*是否重复*/
background-repeat: no-repeat; }

 

分类:

技术点:

相关文章:

  • 2021-09-26
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-12
  • 2021-11-13
  • 2022-12-23
  • 2022-02-08
  • 2021-11-23
  • 2022-12-23
  • 2021-12-23
相关资源
相似解决方案