Basically I have a part of html which for some reason it's child elements are displaying above of it's parent's siblings and I have no idea why.
.container {
position: relative;
}
#greeting {
background: red;
}
.thing-container {
position: absolute;
z-index: -1;
}
.things {
height: 40px;
width: 40px;
background-color: black;
}
<div class="container">
<div id="greeting">hello</div>
<div class="thing-container">
<div class="things"></div>
<div class="things"></div>
</div>
</div>
For some reason .things are displaying above #greeting
I tried to set the z-index of .things at -1 and that worked but why do I have to do it like that? I expected the parent to be able to maximize their z-index or something.