Parsing ie, FireFox, Opera browser Support Alpha Transparent method _ Experience Exchange

Source: Internet
Author: User
First, look at the following code:
Copy Code code as follows:
Filter:alpha (OPACITY=50); /* IE * *
-moz-opacity:0.5; /* Moz + FF */
opacity:0.5; /* Support CSS3 Browser (FF 1.5 also supported) * *

Simply explained, IE uses private property filter:alpha (opacity), Moz family uses private property-moz-opacity, and standard attributes are opacity (CSS 3, Moz family). The value that follows is transparency, using percentages or decimals (alpha (opacity)) to use a value greater than 0 or less than 100, which is actually a percentage.

You don't see opera from the code above. Yes, opera doesn't support standard opacity, nor does it have proprietary properties that can support alpha transparency.

However, we know that opera is supporting alpha-transparent PNG images (of course Moz family also supports). So we can use the background image to achieve the alpha transparency effect.

Example: http://realazy.org/lab/alpha/

The key is:
Copy Code code as follows:
Background:transparent URL (alpha80.png) left top repeat!important;
Background: #ccc;
Filter:alpha (OPACITY=50);
Since Moz family supports alpha-transparent PNG, we do not need to use its private properties. Of course, you can use standard opacity, but don't use alpha-transparent images and opacity at the same time, which is a mixture of the two. You can download the example above and then/*opacity:. 5;*/'s comment.

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.