Numbered list auto-increment

This is possible. Here’s one way I found with a quick internet search - slightly modified - I pulled out all styling from the linked post, along with some stuff that was affecting bullets:

/* hierarchical ordering:  */
ol {
	counter-reset: item
}
ol li {
  display: block
}
ol li:before {
  content: counters(item, ".") ". ";
  counter-increment: item
}
section > ol li::before {
	position: relative;
}

It leaves lists with pure bullets alone, but is messy with lists that have both. If you by chance need that I’m sure some deeper searching will show an answer somewhere!

Here’s what I get using the above (in case it isn’t clear, editor on top, preview on bottom)

4 Likes