兼容 IE6 的遮罩层
2014-01-30 · 125 chars · 1 min read
兼容 IE6 的遮罩层,利用“* Html”这个 Hack,设置 IE6 使用 position
;和 expression 来模拟 fixed 的效果,另外设置 background(*)防止抖动。.overlay {
position: fixed;
z-index: 100000; /*按需设置*/
width: 100%;
height: 100%;
top: 0;
left: 0;
filter: alpha(opacity=50);
opacity: 0.5;
overflow: hidden;
background-color: #000;
}
* html {
background: url(*) fixed;
}
* html body {
margin: 0;
height: 100%;
}
* html .overlay {
position: absolute;
left: expression(
documentElement.scrollLeft + documentElement.clientWidth - this.offsetWidth
);
top: expression(
documentElement.scrollTop + documentElement.clientHeight - this.offsetHeight
);
}


