Skip to content

Instantly share code, notes, and snippets.

@craigbutcher
Last active August 29, 2015 14:15
Show Gist options
  • Save craigbutcher/2186bea6079d6e5178e7 to your computer and use it in GitHub Desktop.
Save craigbutcher/2186bea6079d6e5178e7 to your computer and use it in GitHub Desktop.
Creating ordered list with correct decimal points and alphabetical.
Influenced by [jirutka](https://gist.github.com/jirutka/32049196ab75547b7f47)
From jirutka:
Nested numbered list with correct indentation in CSS
Reused the code + added alphabetical listing.
.order-listing {
ol {
list-style: none;
counter-reset: item;
> li {
display: table;
counter-increment: item;
margin: 0 0 20px;
&:before {
content: counters(item, ".") ". ";
display: table-cell;
font-weight: bold;
padding: 0 10px 0 0;
}
}
li ol > li {
margin: 0;
&:before {
content: counters(item, ".") ". ";
}
ol > li > ol {
counter-reset: alpha;
> li:before {
content: counter(alpha, lower-alpha) ". ";
counter-increment: alpha;
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment