Css pop-up layer-transparent layer and css pop-up layer
<! DOCTYPE html>
<Html lang = "en">
<Head>
<Meta charset = "UTF-8">
<Title> transparent layer-pop-up layer </title>
<Style>
* {Margin: 0; padding: 0 ;}
. Main {width: 100%; height: 1000px ;}
. Div1 {
Top: 0;
Left: 0;
Width: 100%;
Height: 1000px;
Position: absolute;
Z-index: 10;
}
. Div2 {
Width: 100%;
Height: 1000px;
Z-index:-1;
Position: absolute;
/** Transparent layer */
Background: #000000;
Filter: alpha (opacity = 70 );
-Moz-opacity: 0.7;
-Khtml-opacity: 0.7;
Opacity: 0.7;
}
. Div3 {
Margin-left: 100px;
Width: 100px;
Height: 200px;
Background: yellow;
}
</Style>
</Head>
<Body>
<Div class = "main"> dsadd </div>
<Div class = "div1">
<! -- Because the child element inherits the parent element's transparent layer opacity, an empty div is defined as the transparent layer. -->
<Div class = "div2"> </div>
<Div class = "div3"> wqeqwe </div>
</Div>
</Body>
</Html>