There's two ways to do this: One is to just set the background-color of the container to a transparent color,with rgba(r,g,b,.5)
- However, this is CSS3 and only supported in newer browsers.
The other way is to drop an absolutely positioned div inside the container, with an opacity of .5.
<div class="backgroundOpacity">
My Epic Content
</div>
<br/>
<div class="backgroundDiv">
<div id="background"> </div>
My Other Epic Content
</div>
.backgroundOpacity {
background-color:rgba(0,0,0,.5);
}
.backgroundDiv {
position:relative;
}
#background {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
background-color:#000;
opacity: .5;
}
http://jsfiddle.net/thomas4g/vVt8D/1/