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