How to override "inherited" z-indexes?
Posted
by Earlz
on Stack Overflow
See other posts from Stack Overflow
or by Earlz
Published on 2010-03-16T21:29:58Z
Indexed on
2010/03/16
21:31 UTC
Read the original article
Hit count: 162
I am needing to override the notion of inherited z-indexes.
For instance in this code
<style>
div{
background-color:white;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
}
</style>
<div style="position: fixed; z-index: 2;">
div 1
<div style="position: fixed; z-index: 3;">
div 2
</div>
</div>
<div style="position: fixed; z-index: 2;">
div 3
</div>
I want for div 2
to be displayed, but instead div 3
is displayed. How can I change this behavior without changing my structure.
© Stack Overflow or respective owner