Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Created July 15, 2013 03:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save LeaVerou/5997331 to your computer and use it in GitHub Desktop.
Save LeaVerou/5997331 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
*/
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;
}
<ul>
<li>Aaaaaaaa</li>
<li>B</li>
<li>Ccccccc</li>
<li>D</li>
<li>Eeeeeeeeeeeeeeeeee</li>
<li>Fff</li>
<li>Gg</li>
</ul>
// alert('Hello world!');
{"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