This property sets a named counter (for display with the content property), to a particular value, each time the enclosing style rule is matched.
By default, the counter is reset to zero, but you can specify any value you like.
Inherited: No
See also: Section B.26counter-increment
A counter name, optionally followed by a positive or negative integer that specifies the new value for the counter (the default it 0). If you want to set multiple counters for a single element, you can separate their names (and optional integers) by spaces.
The default value, none is also supported, but is of little practical use.
Initial value: none
CSS Version: 2
Not supported by any currently-available browser.
This example lets you use h1 elements to mark chapters, h2 elements to mark subsections, and have hierarchical numbering on section headings:
h1 { counter-increment: chapter; counter-reset: section; } h1:before { content: "Chapter " counter(chapter) " - "; } h2 { counter-increment: section; } h2:before { content: "Section " counter(chapter) "." counter(section) " - "; }