Css mask code (verified) and css mask code verification

Source: Internet
Author: User

Css mask code (verified) and css mask code verification

# Mask {background-color: rgb (0, 0, 0); display: none; opacity: 0.0;/* Safari, Opera */-moz-opacity: 0.0; /* FireFox */filter: alpha (opacity = 0);/* IE */z-index: 100; height: 100%; width: 100%; background-repeat: repeat; position: fixed; top: 0px; left: 0px ;}

We can see that the above style implements a translucent mask layer. We only need to place a div label in our body, as shown below:

<Div id = "mask" class = "mask"> </div>

When you need a mask, you only need to make the mask visible:

$ ("# Mask"). show ();

Finally, the content we want to display is centered on the top of our mask layer to achieve the desired effect. The position is controlled by z-index. The display content on the mask layer usually needs to be centered. If you are not familiar with css center, please check the water fee.

Related Article

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.