The counter-reset property contains a list of one or more names of counters, each one optionally followed by an integer. The integer gives the value that the counter is set to on each occurrence of the element. The default is 0.

  • Initial valuenone
  • Applies toAll elements
  • InheritedNo
  • MediaAll
  • Computed valueSpecified value
  • AnimatableNo
  • CSS VersionCSS2, CSS3
  • JavaScript
Formal syntax: [ <custom-ident><integer>? ]+ | none

counter-reset: section;      /* Set section to 0 */
counter-reset: none;
  • noneThis element does not alter the value of any counters.
  • <custom-ident><integer>?The element alters the value of one or more counters on it. If there is not currently a counter of the given name on the element, the element creates a new counter of the given name with a starting value of 0 (though it may then immediately set or increment that value to something different).
h1:before {
   content: "Chapter " counter(chapter) ":"
   counter-increment: chapter;
   counter-reset: section;

Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.