Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Cross Browser Opacity Re: Cross Browser Opacity

#110556
Kitty Giraudel
Participant

You might want to use width: 100% instead of width: 200000em. I think your browser will thank you for that. :)

About opacity, you can’t do much better than:


.transparent_class {
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";

/* IE 5-7 */
filter: alpha(opacity=50);

/* Netscape */
-moz-opacity: 0.5;

/* Safari 1.x */
-khtml-opacity: 0.5;

/* Good browsers */
opacity: 0.5;
}

Source: https://css-tricks.com/snippets/css/cross-browser-opacity/

You could also use a rgba or hsla color on your header instead of using an overlay. I think it would be smarter.