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.