Counters can be used to automatically number elements within your document.
In this sample, all ordered lists in the document are numbered started from 1. The corresponding number is displayed before each list.
* { counter-reset: ol }
ol { counter-increment: ol }
ol:before { content: counter(ol, decimal) }You can also define the list type, e.g. decimal, as indicated in the sample above. You can find a list of supported list-style-types in the table ???
Nested counters can also be used:
h2 { counter-reset: heading }
h3 { counter-increment: heading }Consequently, the counter of h3 is reset when reaching a h2 tag.