For instance, take the following HTML & CSS:
<div class="fixed"></div>
<div class="wrapper">
<div class="child"></div>
</div>
.fixed {
background: blue;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
}
.wrapper, .child {
position: absolute;
height: 20px;
width: 20px;
padding: 20px;
}
.wrapper {
z-index: 1;
background: red;
}
.child {
position: absolute;
z-index: 3;
background: yellow;
}
Expected behaviour would be that .child
displays above .fixed
whilst .wrapper
is invisible however on http://jsfiddle.net/STLMR/ .fixed
shows above all (tested in Chrome + Firefox). Is there some trick to this, or is there some quirk of CSS I'm missing?