Account
Categories
Shobha
Shobha
The best way to predict the future is to invent it

What are CSS counter properties, and how are they used?

CSS counters are variables used to track and manipulate numeric values in elements. They are often used for creating automatic numbering in lists or headings. You define a counter with counter-reset, increment it with counter-increment, and display its value using content: counter(counter-name). For example:

counter {
counter-reset: section;
}
.counter h2::before {
counter-increment: section;
content: "Section " counter(section) ": ";
}