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? Andrew J. Leer about 9 years ago
  • backgrounds are transparent, unless you set a color, so somewhere you have an inherited color problem. can't see your site though - session issue? Tony Crockford about 9 years ago

1 answer

Jordan 469

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.

       -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.

Answered about 9 years ago by Jordan
  • Firefox has been supporting plain "opacity" since FF 0.9 (currently 3.6), so no need for the "-moz -opacity" line. stoneMonkey77 about 9 years ago
  • Sorry forgot the reference: stoneMonkey77 about 9 years ago
  • 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 :) Gary Hepting about 9 years ago
  • 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! Tony Crockford about 9 years ago