Saturday, January 10, 2009

Cross Browser CSS Opacity

Here's a simple CSS Tip from arbnet.net.

If you want your transparency to translate to all browsers, then make sure to use all four of the elements shown below.


.class {
opacity: 0.7;
filter:alpha(opacity=70);
-moz-opacity:0.7;
-khtml-opacity:0.5;
}

The first is CSS Standard and will work in all standards compliant browsers, the second is for Internet Explorer, the third for older Mozilla browsers and the last for older Safari browsers.

No comments: