I have been toying with the opacity property lately, and I have come accross this problem with a page centered layout I have.
The thing is, I have a complex background image (
underwater picture), and while I know how to create a PNG transparency with a simple background image, I don’t know how to do this with this kind of background.
Even if opacity (translucency) is a style property defined in CSS-3 specification CSS3 Color Module, chapter 3.2, browsers already support it. According to the spec, opacity can be thought of conceptually as a postprocessing operation, so the selected grade of transparency is applied to all its content.
It means that, if you have a DIV with text inside, it is impossible to have opaque text on translucent background, because if you set the opacity property for the container DIV, all its content inherits the transparency and it is impossible to override it... by normal means.
If you try this example code, you will find that opaquetext is not opaque, it inherited the parent opacity attribute and style redefine is discarded, for the reason explained above.
See :
http://developer.mozilla.org/en/docs/Useful_CSS_tips:Color_and_Background
There are two workarounds (see link above), but each involve absolute positionning which I don’t want.
I have submitted this to a few qualified people but nobody has a solution to offer...
I wondered if one of the whiz designers around here could figure out a way to do this ?
Thanks !