-
-
Save depoulo/5998057 to your computer and use it in GitHub Desktop.
CSS Puzzle: Reverse the z-order of the <li>s without setting a separate z-index on each one in a way that works in IE9 and up
This file contains hidden or 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
/** | |
* CSS Puzzle: Reverse the z-order of the <li>s without setting a separate z-index on each one in a way that works in IE9 and up | |
*/ | |
li { | |
list-style: none; | |
display: inline-block; | |
padding: 1em 2em 1em 1em; | |
border: 1px solid rgba(0,0,0,.3); | |
border-radius: 0 999px 999px 0; | |
background: beige; | |
} | |
li:not(:first-child) { | |
margin-left: -1.6em; | |
} | |
li::after { | |
content: "."; | |
display: block; | |
} | |
li + li { | |
} |
This file contains hidden or 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
<ul> | |
<li>Aaaaaaaa</li> | |
<li>B</li> | |
<li>Ccccccc</li> | |
<li>D</li> | |
<li>Eeeeeeeeeeeeeeeeee</li> | |
<li>Fff</li> | |
<li>Gg</li> | |
</ul> |
This file contains hidden or 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
// alert('Hello world!'); |
This file contains hidden or 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","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