Css pop-up layer-transparent layer and css pop-up layer

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.