leo列

导航

关于IE6遮罩层的问题

<div class="mark"></div>

这是一个遮罩层,在很多情况下需要用到遮罩层,如放大镜啊,弹出框啊等等。这些效果需要遮罩层透明,理所当然地会这样写样式

.mark {width:100%; height:100%; position:absolute; z-index:2; left:0px; top:0px; background:#fff; opacity:0.3; filter:alpha(opacity=30); }

这样写有一个弊端,ie6下不兼容,那这样写呢?

.mark {width:100%; height:100%; position:absolute; z-index:2; left:0px; top:0px; }

这样写在IE6,IE7下会选不中这个元素,因此既可以兼容也能选中的可以用透明像素平铺解决,像:

.mark {width:100%; height:100%; position:absolute; z-index:2; left:0px; top:0px; background:url(images/T12pdtXaldXXXXXXXX-2-1.png) repeat;}

posted on 2012-11-05 16:29  leo列  阅读(1852)  评论(0编辑  收藏  举报