要求宽度高度自动布满屏幕,且是完整的图片布满,是加个div还是直接在body加背景呢
想要这样的效果么? https://gist.github.com/isayme/3ae56568728675d3fddb
div{
z-index: 0;
position: fixed;
left:0;
top:0;
width:100%;
height:100%;
background: url();
background-size: 100% 100%;
background-repeat: no-repeat;
}
background-size:contain; 适应
background-size:cover; 填充
background-size:fixed; 相对屏幕固定