Skip to content

Instantly share code, notes, and snippets.

@DanWebb
Last active February 5, 2018 08:06
Show Gist options
  • Save DanWebb/0ad321966ae582c74256 to your computer and use it in GitHub Desktop.
Save DanWebb/0ad321966ae582c74256 to your computer and use it in GitHub Desktop.
Style ol and ul numbers or bullets separately
ul {
list-style: none;
padding-left: 1.1225em;
}
ul li {
position: relative;
padding-bottom: 3px;
}
ul li::before {
content: "\2022";
color: green;
position: absolute;
left: -1.1225em;
padding-right: 0;
}
ul, ol {
list-style: none;
padding-left: 1.1225em;
}
ol {
counter-reset: li;
position: relative;
}
ul li {
position: relative;
padding-bottom: 3px;
}
ul li::before,
ol li:before {
content: "\2022";
color: blue;
position: absolute;
left: -1.1225em;
padding-right: 0;
}
ol li:before {
content: counter(li)'.';
counter-increment: li;
left: -0.1225em;
font-weight: bold;
}
ul, ol { list-style: none; margin: 0; padding: 0; color: green; }
ol { counter-reset: li; }
ul li:before, ol li:before { padding-right: 5px; color: red; }
/* Swap out the bullets/numbers for custom text */
ul li:before { content: "\2022 "; }
ol li:before { content: counter(li)'.'; counter-increment: li; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment