1, Rgba basically can solve the matte effect of transparent background: RGBA (0, 0, 0, 0.5), the effect as shown:
2, but rgba in IE8 and below is incompatible, you can use IE filter processing:
Filter:progid:DXImageTransform.Microsoft.Gradient (startcolorstr= #7F000000, endcolorstr= #7F000000);
The first two bits are hexadecimal opacity, and the rear six bits are color values. Common transparency and hex relationships, details stamp here
With the IE filter processing, IE8 and the following browsers have a mask transparency effect, but the IE9 color is deepened:
Because IE9 also recognizes both RGBA and filter, the effect overlaps, so you need to add the mask layer (CLSAA to hide):
: Root. Hide{filter:none;}
: Root supports IE9 and above browsers, with spaces behind the class name
.
So far transparent masks are compatible with all browsers ...
Is there a better way to one go the effect of a transparent matte?
3. Capture a 1-pixel transparency effect picture (. png) and add a background image to hide:
Background compatibility or invincible, invincible is how lonely ...