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

Source: Internet
Author: User
First, look at the following code:
Copy the Code code as follows: Filter:alpha (OPACITY=50); /* IE */
-moz-opacity:0.5; /* Moz + FF */
opacity:0.5; /* Browsers that support CSS3 (FF 1.5 is also supported) */
Simply explained, IE uses private attribute filter:alpha (opacity), Moz family uses private attribute-moz-opacity, while the standard attribute is opacity (CSS 3, Moz family section supports CSS3). The values that follow are transparency, using percentages or decimals (alpha (opacity)) to use values greater than 0 and less than 100, which are actually percentages.

You don't see opera from the above code. Yes, opera does not yet support standard opacity, nor does it have a proprietary property that supports alpha transparency.

We know, however, that opera is a PNG image that supports alpha transparency (and of course Moz family support). So we can use the background image to achieve the alpha transparency effect.

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

The key is:
Copy the 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, it's not necessary to use its private properties. Of course, you can use the standard opacity, but don't use alpha transparent pictures and opacity at the same time, so that's a mixture of the two. You can download the above example, and then/*opacity:. 5;*/'s comments to see.
  • 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.