Skip to content

Instantly share code, notes, and snippets.

@myasseen
Last active August 29, 2015 14:15
Show Gist options
  • Save myasseen/105b3282b772a65f7ae6 to your computer and use it in GitHub Desktop.
Save myasseen/105b3282b772a65f7ae6 to your computer and use it in GitHub Desktop.
CSS: Ordered List without the Period.
/*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