Skip to content

Instantly share code, notes, and snippets.

Created July 15, 2013 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5997449 to your computer and use it in GitHub Desktop.
Save anonymous/5997449 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
/**
* 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
*/
body {perspective: 10000px;}
ul {transform: rotateY(1deg); transform-origin: 0 0; perspective: 10000px; transform-style: preserve-3d;}
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;
transform: rotateY(-1deg);
transform-origin: 0 0;
}
li:not(:first-child) {
margin-left: -1.6em;
}
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
<li>D</li>
<li>E</li>
<li>F</li>
<li>G</li>
</ul>
// 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