After a background image is repeated, the entire page is not zoomed, and a background image is zoomed and not repeated to cover the entire page

Repeated background images, no zoom, full page

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>这是网页标题</title>
    <style type="text/css">
        div
        {
     
     
            width:100%;
            height:100%;
            background-size:auto;/*这个用来实现不缩放(默认的),缩放是cover*/
            position:absolute;/*这一行必须要有,但上一行不是必须的,因为auto是默认值*/
            background-image: url(../image/背景图1.png);
            background-repeat:repeat;/*这一行也可以没有,因为repeat是默认值*/
            background-attachment: fixed;/*这一行也可以没有,虽然默认值不是fixed,但对效果显示无影响*/
        }
    </style>
</head>
<body >
    <div></div>
</body>
</html>

Insert picture description here
Insert picture description here

The background image does not repeat, zoom, and fill the page
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44575911/article/details/107561617