Pseudo Classes & Elements
Copyright © 2014 by tutorialspoint
CSS - counter-increment
The counter-increment property sets how much the counter increments on each occurrence of a selector. Default increment is 1.
- name: The name of a counter. The name can be any string value.
- integer: Defines an increment for the named counter each time the element appears in the document. This increment can be zero, or even negative. If no integer is provided, the counter is incremented by one.
- none: No increment is performed.
All the HTML elements.
This example shows a way to number chapters and sections with "Chapter 1", "1.1", "1.2", etc.
content: "Chapter " counter(chapter) ". ";
counter-increment: chapter; /* Add 1 to chapter */
counter-reset: section; /* Set section to 0 */
content: counter(chapter) "." counter(section) " ";