CSS counter are the variable maintained by the CSS. It will increase whose value by using CSS rules.
Automatic Numbering with counter
There are various CSS counters properties that are given below:
- counter-reset: It is used to create or resets a counter.
- counter-increment: It is used to increment a counter value.
- content: It is used to insert generated content.
- counter() or counters() function : It is used to add the value of the counter of an element.
Note: You must have to create counter-reset.
Let us see an example of CSS counter:
content: "Sectioncount " counter(section) ": ";
<h1>Example of CSS Counter</h1>
<p><b>Note:</b> IE8 supports these properties only if a !DOCTYPE is specified.</p>