首页 > 代码库 > 透明背景和遮罩层

透明背景和遮罩层

1 <div class="searchBlock">2       <div class="center1_filter"></div>3       <div class="field"></div>4 </div>
1 .searchBlock{width: 800px;height:120px;position: absolute;top:50%;left: 50%;margin-top: -97px;margin-left: -400px;padding: 15px 19px;}2 .center1_filter{width: 100%;height: 100%;position: absolute;top:0;left: 0;background-color: #000;filter:alpha(opacity=50);-moz-opacity:0.5;-webkit-opacity: 0.5;-o-opacity: 0.5;-ms-opacity: 0.5;opacity: 0.5;z-index: -1;}

 遮罩层与透明背景类似,只是不要写z-index: -1;

透明背景和遮罩层