CSS3 Study Notes (5)-page Matte effect

Source: Internet
Author: User

Today the page mask the effect of hair, before the mask is implemented with JS, and suddenly found CSS3 inside the Box-shadow attribute in addition to do three-dimensional shadow, but also to do the page mask ~ ~ ~

Let's take a look at the dynamic effects of completion:

As can be seen, is when the mouse hover over the button, the entire page will appear matte, of course, the transparency is often seen in the Web page when the mouse hover over a picture, the surrounding other pictures are masked, so that the effect of highlighting this picture, in fact, this effect made very simple ~~~~~

First, the main procedure:

<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "Utf-8" />        <title></title>        <Linkrel= "stylesheet"href= "Css/mask_layer.css"type= "Text/css">    </Head>    <Body>        <P></P>        <Divclass= "Mask_layer">            <ahref="#"Target= "_blank">Transparent matte</a>        </Div>    </Body></HTML>

There is nothing to say, very simple, see for yourself ~ ~ ~

Second, CSS style (mainly CSS3)

First, the principle:

Box-shadow property: The position of the horizontal shadow vertical shadow shadows the shadow of the shaded program shadow of the size of the shadow is the color of the inner shadow;

Since we know the principle, then we can hover over the frame when the mouse shadow size is larger than this page, so you can cover up ~ ~ ~

. mask_layer{    width:200px;    height:30px;    border:1px #7ed2ed solid;    Background: #7ed2ed;    Text-align:center;    line-height:30px;    position:relative;    z-index:999;}. Mask_layer a{    Text-decoration:none;    Color: #323232;    Font-weight:bold;}. mask_layer:hover{    box-shadow:0 0 0 9999px Rgba (0,0,0,.4);    -webkit-box-shadow:0 0 0 9999px Rgba (0,0,0,.4);   -moz-box-shadow:0 0 0 9999px Rgba (0,0,0,.4);   -ms-box-shadow:0 0 0 9999px Rgba (0,0,0,.4);   -o-box-shadow:0 0 0 9999px Rgba (0,0,0,.4);}

The amount ..... Look at the style is not want to vomit blood, too simple ~ ~ ~ ~ I'm embarrassed to write it out ~~~~~ need to be aware that the frame needs to be placed at the top, so you need to use the Z-index property.

CSS3 Study Notes (5)-page Matte effect

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.