I would like to set opacity to a parent div but not 1 particular child div. So i have a html code like:
body {
background-image: url(http://url.jpg)
}
#main {
opacity: 0.9;
}
#slider {
opacity: 1;
}
<body>
<div id="main">
<div id="slider">
</div>
<div id="content-wrapper">
</div>
</div>
</body>
Obviously this won't work. The whole #main div is now transparant to the background div. That is what i want but not the #slider div. For some reason, when only setting opacity
to the #content-wrapper, nothing happens at all.
Any ideas?
Edit: I can't use an rgba color, since i would like the background image to come through. Could you explain why adding opacity to #content-wrapper is not working?