body{
background-image:url(./assets/default.gif);
background-position:center;
background-size: cover;
background-repeat:no-repeat;
background-attachment: fixed;
}
更改网页大小效果如下,图片会自动放大缩小铺满网页,不过这样当网页变小时看不到整张图片。
body{
background-image:url(./assets/default.gif);
background-position:center;
background-size: cover;
background-repeat:no-repeat;
background-attachment: fixed;
}
更改网页大小效果如下,图片会自动放大缩小铺满网页,不过这样当网页变小时看不到整张图片。