Today we will learn about CSS Alpha transparency.
Knowledge about CSS Alpha transparency. See the following Code :
Copy code The Code is as follows: filter: alpha (opacity = 50);/* ie */
-Moz-opacity: 0.5;/* Moz + FF */
Opacity: 0.5;/* supports css3 browsers (FF 1.5 is also supported )*/
Internet Explorer uses the private attribute filter: alpha (opacity), Moz family uses the Private Attribute-moz-opacity, and the standard attribute is opacity (CSS 3, the Moz family part supports css3 ). The following value is transparency. The percentage or decimal number (alpha (opacity) is used to use a value greater than 0 and less than 100, which is actually a percentage ).
You have not seen opera from the code above. Yes, opera does not yet support standard opacity, nor does it have private attributes that support alpha transparency.
However, we know that opera supports alpha-transparent PNG images (also supported by Moz family ). Therefore, we can use background images to achieve alpha transparency.
The key lies in:Copy codeThe Code is 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 attributes. Of course, you can use the standard opacity, but do not use the Alpha transparent image and opacity at the same time. In this way, the two are mixed. You can download the example above, and then/* opacity:. 5; */to see the annotations.