Skip to content

Instantly share code, notes, and snippets.

@kizu
Forked from LeaVerou/dabblet.css
Created May 5, 2012 22:23
Show Gist options
  • Select an option

  • Save kizu/2605957 to your computer and use it in GitHub Desktop.

Select an option

Save kizu/2605957 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;
display: inline-block;
vertical-align: middle;
width: 200px; height: 200px;
background: yellowgreen;
}
div > div {
position:absolute;
z-index: -1;
width: 200px; height: 200px;
background: #d00;
}
.opacity {
opacity: 0.9;
}
.transform {
transform: rotate(0);
}
Normal:
<div>
<div></div>
</div>
With opacity:
<div class="opacity">
<div></div>
</div>
With transform:
<div class="transform">
<div></div>
</div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment