I have a container with a background and opacity set. In it, I have a child. I want the child to appear to be on top of the container, but it isn't, the opacity affects the child.
Here's the HTML
<div class="container">
<div class="child">some label</div>
</div>
And CSS:
.container {
position: absolute;
top: 0;
width: 200px;
height: 200px;
opacity: 0.5;
background-color: lightblue;
z-index: 10;
}
.child {
position: absolute;
right: 0;
bottom: 0;
}
For other reasons, the container must have a position of absolute.
The jsfiddle is here.
How can I avoid the opacity of the container affecting the child?