1. Home
  2. Computing & Technology
  3. Web Design / HTML

counter-increment

By Jennifer Kyrnin, About.com

counter-increment Description:

The counter-increment property defines the names of counters and by how much they are incremented each time the counter is invoked.

counter-increment in CSS Versions:

counter-increment Syntax:

counter-increment: <identifier> <integer> | none | inherit

  • <identifier>
    Defines the element by id that should be incremented.
  • <integer>
    Defines how much the counter should be incremented. Default is 1.
  • none
    Do not increment the counter.
  • inherit
    The element should have the same counter-increment setting as the parent.

counter-increment Initial Value:

none

counter-increment Applies To

All elements.

counter-increment Inheritance:

This property is not inherited.

counter-increment Browser Support:

counter-increment media type:

  • All

counter-increment Examples:

Add 1 to chapter divs

<style>
div.chapter:after {
content: "Chapter: " counter(chapter);
counter-increment: chapter;
}
</style>

Increment section titles by 2

h1.section:before {
content: "Section: " counter(section);
counter-increment: section 2;
}

counter-increment Special Notes:

  • Internet Explorer does not support this property.
  • Mozilla browsers do not support this property.

More counter-increment Information

Return to the Style Library

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: counter-increment

©2008 About.com, a part of The New York Times Company.

All rights reserved.