#body {background: transparent url(background/image.png) 0 0 repeat-y;
}
#content-wrap {width: 60%;
margin: 0 auto;
background: transparent url(partially/transparent/60percent-opaque.png) 0 0 repeat;
}
#main-content {width: 90%;
margin: 1em auto 0 auto;
background-color: #fff;
}
#footer {width: 90%;
margin: 1em auto 0 auto;
background-color: #fff;
}
This sets a partially-transparent .png
image as the background for the #content-wrap
section, with a solid color background for the divs (I've used #main-content
and #footer
, but they've got the same style so you could just use #content-wrap div
and shorten the css a little.
<div id="content-wrap">
<!-- this is the outer wrapping div -->
<div id="main-content">
<!-- this I'm assuming is the main content portion -->
</div>
<div id="footer">
<!-- the name explains my assumption, I think... -->
</div>
</div>
...if you know that your audience will be using FF3.x (and probably webkit based browsers), you could use background-color: rgba(0,0,0, 0.6);
to define the background-colour (red=0, green=0, blue=0, alpha=0.4 or 40% opaque (or 60% transparent) -the values being between 0
(entirely transparent) and 1
(entirely opaque).)
Using the rgba
for colour prevents problems from using opacity
to make the parent div transparent, while trying to make the children visible. But it's got limited use because of browser adoption, of course...
A working demo is over at my site: http://www.davidrhysthomas.co.uk/so/transparent.html