What is the CSS counter-increment property?
The counter-increment property in
This property is used with the
contentand thecounter-resetproperty.
Syntax
counter-increment: none|id|initial|inherit;
Property values
-
none: This is the default value, and by using this, we can not change the counter’s value. -
id: It is used to specify which counter has to be incremented and also to specify that how much we want to increment. The default increment value is 1. -
initial: This sets the value to its default value. -
inherit: This inherits property from its parent value.
Code
The following is the basic counter-increment property:
Explanation
In this example, we can see that we have made the counter on Employee. So, when we add the details of any employee, it is automatically incremented by 1.