CSS counter-reset

The CSS counter-reset property assists in generating automatic numbering (for example, Heading 1, Heading 2, Heading 2.1 etc) by resetting the count as required.

Every element has a collection of zero or more counters, which are inherited through the document tree. Counters have a name, an integer value, and a creator element. They can also have another counter nested inside themselves.

The counter-reset property creates one or more new counters on an element. Each counter has a name/identifier and a count associated with that identifier.


Possible Values

This element does not create any new counters.
custom-ident integer?

The element creates one or more new counters. Each custom-ident names a new counter to be created. It's followed by an (optional) integer which provides the counter's starting value. If a starting value isn't provided, it starts at 0.

The counter can then be incremented or decremented with the counter-increment property.

In addition, all CSS properties also accept the following CSS-wide keyword values as the sole component of their property value:

Represents the value specified as the property's initial value.
Represents the computed value of the property on the element's parent.
This value acts as either inherit or initial, depending on whether the property is inherited or not. In other words, it sets all properties to their parent value if they are inheritable or to their initial value if not inheritable.

General Information

Initial Value
Applies To
All elements

Example Code

Official Specifications