How do i make IE FF Opera support alpha transparency at the same time? -DIV+CSS Tutorial
The transparent effect of the picture is a special form that needs to be used in the webpage, although not very commonly used, but meet this kind of demand often a bit unprepared.
Knowledge about CSS alpha transparency. First, look at the following code:
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.
The key is:
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 look at the/*opacity:.5;*/comments.