I'm try to add a white div on top of an image, then add opacity to the white layer so that I can put text over the image.
The HTML:
<div id="red">
<div id="white">
<div id="blue"></div>
</div>
</div>
The CSS:
div {
width: 300px;
height: 300px
}
#red {
background: red;
position: relative;
z-index: -15;
}
#white {
background: white;
opacity: 0.5;
position: relative;
z-index: -10;
}
#blue {
background: blue;
width: 100px;
height: 100px;
opacity: 1;
}
The background appears pink, which is great. But the blue box I want to appear on top, in blue - but sadly it is purple. So the blue box is a bit opaque for some reason.
How can I make the blue box appear on top, without any opacity?