添加遮罩层

来源:互联网 发布:mac解压不了zip 编辑:程序博客网 时间:2024/05/22 15:02
.shadeDiv{ display: none;  position: absolute;  top: 0%;  left: 0%;  width: 100%;  height: 100%;  background-color: black; -moz-opacity: 0.15;  opacity:0.15;  filter: alpha(opacity=15);}.showDiv {    text-align: center;    width: 420px;    height: 420px;    left:50%;/*FF IE7*/    top: 50%;/*FF IE7*/    margin-left:-210px!important;/*FF IE7 该值为本身宽的一半 */    margin-top:-210px!important;/*FF IE7 该值为本身高的一半*/    margin-top:0px;    position:absolute;}

定义两个class,shadeDiv 为隐藏的,showDiv为显示的

<div id="shadeAddUserDiv" class="shadeDiv" style="z-index:106;"></div><div id="addUserDiv" class="tableInfo showProDiv" style="padding:0;background:#fff;z-index:107;display:none;">

只需在自己定义的div中加入class,并添加z-index:xxx就可以了,数字越大就在上面。

原创粉丝点击