Skip to content

Instantly share code, notes, and snippets.

@maxw3st
Forked from LeaVerou/dabblet.css
Created May 5, 2012 22:12
Show Gist options
  • Save maxw3st/2605923 to your computer and use it in GitHub Desktop.
Save maxw3st/2605923 to your computer and use it in GitHub Desktop.
Weird behavior when combining opacity & z-index: -1
/**
* Weird behavior when combining opacity & z-index: -1
*/
div {
position: relative;
width: 200px; height: 200px;
background: yellowgreen;
/* Try commenting this or setting it to 1: */
opacity: 1;
}
div > div {
position:absolute;
z-index: -1;
width: 200px; height: 200px;
background: #d00;
}
<div>
<div></div>
</div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment