CSS counters let you create dynamic lists without JavaScript. In this lesson, we will create a multi-level table of contents using the CSS counter-reset
and counter-increment
properties with the counter
attribute.
Counters are great :) The only downside is that putting data in the content property is not always accessible, so we only should generate content via CSS that is not essential for the user. Otherwise, some screen readers won't read the CSS generated content.