In the test site here, I'm trying to add a transparent background to the div element #content_column, because in IE6 and IE7 it displays with a solid white background.
Is there any fix for this? I've already tried setting it to background-color: transparent; without any luck.
- See how in IE6 / IE7 the sandwich gets covered up?
- backgrounds are transparent, unless you set a color, so somewhere you have an inherited color problem. can't see your site though - session issue?
1 answer
points
To make an HTML element transparent. Just use these css elements in your css class. filter, moz-opacity, opacity.
Internet Explorer uses filter and firefox uses moz-opacity.
{
filter:alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
}
An opacity value of 1 means the element is fully opaque; an opacity value of 0 means an element is not at all opaque, i.e. fully transparent.
- Firefox has been supporting plain "opacity" since FF 0.9 (currently 3.6), so no need for the "-moz -opacity" line.
- Sorry forgot the reference: https://developer.mozilla.org/en/CSS/opacity
- Good point, I've been redundantly coding both CSS properties for years now... Gotta quit wasting precious keystrokes and making needless CSS warnings during validation :)
- a div will have a transparent background unless you set a color, no need for all this opacity stuff, that's to set an element to opaque!

