Css alpha transparent attribute description

Source: Internet
Author: User

View code

The code is as follows: Copy code
<Div class = "top"> <div class = "sub"> css opacity attribute! </Div>

In the above structure, if you set the top opacity attribute to achieve the transparent effect, you will find that all the elements in it inherit the transparent effect, which obviously cannot meet the requirements. At least the font must be clear.
Collected related knowledge points from the internet

First, the standard css transparent writing is provided, which is compatible with most browsers.

The code is as follows: Copy code
. Top {filter: alpha (opacity = 50);-moz-opacity: 0.5;-khtml-opacity: 0.5; opacity: 0.5 ;}

The preceding attributes are as follows:


Opacity: 0.5; this is the most important because it is the CSS standard. This attribute supports Firefox, Safari, and Opera.
Filter: alpha (opacity = 50); this is set for IE6, the value can be 0-100, and the other three 0 to 1.
-Moz-opacity: 0.5; to support earlier Mozilla browsers.
-Khtml-opacity: 0.5; to support some older versions of Safari browsers.
The above example involves the inheritance of transparent attributes.

 

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.