Compatible CSS background transparency

Source: Internet
Author: User
There is an Alpha filter in CSS, which can set the transparency of the target element. You can also specify coordinates to achieve transparency across different ranges. The specific syntax is as follows: reference content: {filter: alpha (opacity = opacity, finishopacity = finishopacity, style = style, startx = startx, starty = starty, finishx = finishx, finishy = finishy )}

Specific parameters:
Opacity transparency. The default range is from 0 to 100. They are actually percentages. That is to say, 0 indicates completely transparent, and 100 indicates completely opaque.
Finishopacity is an optional parameter. If you want to set the transparency of the gradient, you can use them to specify the transparency at the end. The range is also 0 to 100.
Style specifies the shape features of the transparent area: 0 represents the unified shape, 1 represents the linear shape, 2 represents the radial shape, 3 represents the rectangle
X coordinate at the beginning of the startx gradient transparency effect.
Y coordinate at the beginning of the starty gradient transparency effect.
The X coordinate at the end of the finishx gradient transparency effect.
The Y coordinate at the end of the finishy gradient transparency effect.

Test: filter: alpha (opacity = 50 );

# Snake {
Backgournd: #666;
Filter: alpha (opacity = 50 );/* Ie */
-Moz-opacity: 0.5;/* Moz, FF */
Opacity: 0.5;/* Css3, ff1.5 */
}

<Div id = "snake"> background transparency </div>

/**************** This example of Baidu is simpler, haha
// Transparent layer
<Div id = "dialogboxbg" style = "position: absolute; top: 0px; left: 0px; width: 100%; Height: 2999px; Z-index: 10001; opacity: 0.4; background-color: # eeeeee; "/>

// The floating layer above the transparent layer, such as the login form.
<Div id = "dialogbox" style = "border: 1px solid #709cd2; Z-index: 10003; position: absolute; width: pixel PX; left: 410.5px; top: 128px; ">

Opacity: 0.4 // This method applies only to FF
Filter: alpha (opacity = 50); // This method is only applicable to IE
Therefore, these two types can be compatible with ipv_^.

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.