Created
July 2, 2012 12:13
Weird behavior when combining opacity & z-index: -1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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: .9; | |
} | |
div > div { | |
position:absolute; | |
z-index: -1; | |
width: 200px; height: 200px; | |
background: #d00; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<div></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split-vertical","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