CSS Property: counter-reset
Resets a named counter used by generated content.
Possible Values
Value | Description | Example |
---|---|---|
[identifier] | Counter name. Counter will reset to 0. | countername |
[identifier] [integer] | Counter name and the number that the counter should be reset to. | countername 2 |
[multiple identifiers] | Multiple identifiers, or identifiers coupled with integers, will apply the reset to multiple counters. | countername 2 counter2name -5 |
none | No counter reset. | |
inherit | ||
initial | ||
unset |
Example
h3 {
counter-increment: headingnum;
}
h3::before {
content: counter(headingnum);
}
h4:nth-child(4) {
counter-reset: headingnum;
}