CSS Counter-Increment Property

CSS 1

CSS 2

CSS 3

No Yes Yes

Description

This is an automatic counter which can be increased or decreased by a designated value. It can also be used to number lists.

Syntax

content: "[string] " counter([identifier]) " ";
counter-increment: [identifier] [integer];

Possible values

  • none
  • [identifier] [integer]
  • inherit

Initial Value

None

Applies To

All elements

Inherited

No

Media

All

Example

h1:before {
  content: "Chapter " counter(chapter) ":"
  counter-increment: chapter;
  counter-reset: section;
}


View All CSS Properties