css新手教程之背景图充满整个屏幕

gxl26683 9 0 PDF 2020-12-17 15:12:11

想让整个界面有一个背景图片,自然想到的是在body上加background,代码如下: body { width:100%; height: 100%; /* 加载背景图 */ background: url("../static/images/index/backImg.jpg") no-repeat; /* 背景图垂直、水平均居中 */ background-position: center center; /* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */ background-attach

用户评论
请输入评论内容
评分:
暂无评论