Skip to content

Instantly share code, notes, and snippets.

@jeremypage
Last active August 29, 2015 14:18
Show Gist options
  • Save jeremypage/b7040048eb4e4eebfda0 to your computer and use it in GitHub Desktop.
Save jeremypage/b7040048eb4e4eebfda0 to your computer and use it in GitHub Desktop.
CSS: More attractive ordered list style, as used in GitHub Help pages. Displays big bold numbers and a right border.
ol {
counter-reset: li;
list-style: none;
margin: 0;
padding: 0
}
ol>li {
position: relative;
margin-bottom: 1em
}
ol>li::before {
content: counter(li);
counter-increment: li;
position: absolute;
top: 0;
left: 0;
width: 36px;
height: 100%;
min-height: 1em;
font-size: 1.5em;
text-align: right;
border-right: 1px solid #ddd;
padding-right: 10px;
color: #999
}
ol>li::after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0
}
ol>li>* {
margin-left: 57px;
}
ol>li>p:first-child {
margin-top: 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment