首先,为了让CSS实现全屏背景效果,我们需要设置背景图像的属性。使用CSS的background-size属性设置图像的大小,可以让图片完全覆盖整个屏幕。例如:body { background-im
body { background-image: url(mybg.jpg); background-size: cover; }
body { background-image: url(mybg.jpg); background-size: cover; background-position: center center; }
body { background-image: url(mybg.jpg); background-size: cover; background-position: center center; background-attachment: fixed; }
body { background-image: url(mybg.jpg); background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; }
粉丝
0
关注
0
收藏
0