A Guide to CSS counter
5 min readMar 25, 2019
Use the counter
property to turn any element into a numbered list. Similar to how the ordered list tag works <ol>
. Very useful if you're creating a documentation site where you need to automatically number the headings or create a table of contents 👍
div {
/* Define & Initialize Counter */
counter-reset: tidbit-counter;
}h2::before {
/* Increment Counter */
counter-increment…