Skip to content

Instantly share code, notes, and snippets.

@leechy
Created March 20, 2013 15:09
Show Gist options
  • Save leechy/5205441 to your computer and use it in GitHub Desktop.
Save leechy/5205441 to your computer and use it in GitHub Desktop.
z-index of inner element of fixed parent in Chrome not working
/**
* z-index of inner element of fixed parent in Chrome not working
*/
body {
background: white;
min-height: 100%;
margin: 0;
}
.div0 {
position: fixed;
z-index: 70;
height: 20px;
width: 100%;
background-color: black;
}
.div1 {
position: relative;
z-index: 1;
height: 100px;
background-color: pink;
}
.div2 {
position: fixed;
top: 0;
right: 0;
width: 100px;
}
.div3 {
position: absolute;
z-index: 75;
width: 100px;
height: 200px;
background-color: lightgreen;
}
<div class="div0"></div>
<div class="div1"></div>
<div class="div2">
<div class="div3"></div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment