I want to overwrite parent's z-index
for every child element containing a specific class.
There are two different class of children (w/c I can't change since it's generated by API).
First is a .pop-up
and second one is a .label
.
Both will be added under #info
.
HTML Structure
<div id="info">
<div class="pop-up">...</div>
</div>
<div id="info">
<div class="label">...</div>
</div>
Due to different API actions, .label
will sometimes be on top when it gets rendered recently. #info
s z-index
is always 110
.
Thus, I wanted to check if a child element exists (eg. .label
) and update the parent's z-index
to 109
.
Is this possible with css3
? I can't do a hack via JS due to an "agreement".
This is what I've tried, but won't be able to update the parent's z-index
div#info > div.label {
z-index: 109 !important;
}