EDIT: Changed title to actually be correct
I\'m trying to simulate a modal popup in all HTML and CSS and am having a bit of bad luck w
The best way to do this now is to use rGBA colors. It won't work for older browsers, but you can let the design gracefully degrade by just feeding them a solid color. Example:
.parent {
background: gray; /* older browsers */
background: rgba(128,128,128,0.7); /* newer browsers */
}
.child {
background: blue;
}
It is annoying, but CSS doesn't allow that. Setting opacity for one element means no child element can have any greater opacity. (100% of 25% opacity is? Right.)
So, one solution is to use a tiny transparent PNG as a repeating background image to work around that. The only issue there is IE6, and there's an excellent workaround called supersleight.
(Updated. Think supersleight will work for you.)
Update Here's a very simple test case. Create the image (say, a PNG with 50% black fill) and then create this file--save them in the same folder. If you don't see a thin box with a transparent background behind 'stuff', then you're either not saving the file correctly or have saved the image somewhere else.
stuff