can anyone explain why does opacity have any affect on stacking of html element ?
Relevant part of the CSS Code:
div:first-child{
opacity: 0.99;
}
.red{
background: red;
z-index: 1;
}
.green{
background: green;
margin: 20px 0 0 20px;
}
.blue{
background: blue;
margin: 40px 0 0 40px;
}
Plain HTML:
<div>
<span class="red"></span>
</div>
<div>
<span class="green"></span>
</div>
<div>
<span class="blue"></span>
</div>
I am learning about z-index, it seemed pretty simple until i encountered this exception where it seems to have no affect on the stacking order after addition of opacity, can anyone explain the significance of opacity in this particular context?