HTML & CSS · Middle · Question 64 of 75
How can CSS number headings like "Step 1", "Step 2" automatically?
.steps { counter-reset: step; }
.steps h3::before {
counter-increment: step;
content: "Step " counter(step) ": ";
}- ✓Correct answer: With CSS counters:
counter-reset,counter-incrementandcounter() - 2With
list-style: decimalon headings - 3It isn't possible without JavaScript
Explanation
Counters update automatically when items are added or removed. Generated content in ::before isn't selectable and may not be announced consistently by screen readers, so don't put essential info there.