-
-
Save pbb72/d8ae9a91babbb8de7861 to your computer and use it in GitHub Desktop.
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
/** | |
* Nested numbered list with correct indentation. | |
* | |
* View on http://jsfiddle.net/p3rtLw7q/. | |
* Tested on Firefox 32, Chromium 37, IE 9 and Android Browser. Doesn't work on IE 7 and previous. | |
*/ | |
ol { | |
list-style-type: none; | |
counter-reset: item; | |
margin: 0; | |
padding: 0; | |
} | |
ol > li { | |
display: table; | |
counter-increment: item; | |
margin-bottom: 0.6em; | |
} | |
ol > li:before { | |
content: counters(item, ".") ". "; | |
display: table-cell; | |
padding-right: 0.6em; | |
} | |
li ol > li { | |
margin: 0; | |
} | |
li ol > li:before { | |
content: counters(item, ".") " "; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment