Last active
August 29, 2015 14:15
-
-
Save myasseen/105b3282b772a65f7ae6 to your computer and use it in GitHub Desktop.
CSS: Ordered List without the Period.
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
/*Solution 1 (Recommended)*/ | |
ol { | |
counter-reset: item; | |
list-style-type: none; | |
} | |
li { | |
display: block; | |
} | |
li:before { | |
content: counter(item) " "; | |
counter-increment: item; | |
} | |
/*Solution 2*/ | |
ol { | |
list-style-type: none; | |
margin-left: 0; | |
} | |
ol > li { | |
counter-increment: customlistcounter; | |
} | |
ol > li:before { | |
content: counter(customlistcounter) " "; | |
font-weight: bold; | |
float: left; | |
width: 3em; | |
} | |
ol:first-child { | |
counter-reset: customlistcounter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment