代码:
.bgimg{
position:fixed;
top: 0;
left: 0;
width:100%;
height:100%;
min-width: 1000px;
z-index:-10;
zoom: 1;
background-color: #fff;
background: url(../img/bg_login.jpg) no-repeat;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
background-position: center 0;
}
让整个div跟屏幕大小一样
position:fixed;
top: 0;
left: 0;
width:100%;
height:100%;
zoom是CSS hack中专对IE6起作用的部分。IE6浏览器会执行zoom:1表示对象的缩放比例。兼容IE6、IE7、IE8浏览器,经常会遇到一些问题,可以使用zoom:1来解决,zoom有如下作用:1.触发IE浏览器的haslayout; 2.解决ie下的浮动,margin重叠等一些问题。
zoom: 1;