父标签设置:position: relative
自身标签样式
.mask{
position: absolute;
width: 100%;
height: 100%
left: 0;
right: 0;
bottom: 0;
top: 0;
background-color: black;
opacity: .1;
filter: alpha(opacity=10);
z-index: 100;
}
若是想整个屏幕都遮盖住:
.mask{
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: black;
opacity: .1;
filter: alpha(opacity=10);
z-index: 100;
}