Counter Increment Property

Last updated: 2026-09-13

counter-increment Counter Increment Property

counter-increment increases the value of one or more CSS counters and is one of the core mechanisms behind automatic numbering. Each time an element matches the selector, the specified counter is increased by the given step (1 by default). It needs counter-reset and content's counter() function to produce complete automatic numbering.

Category
Initial Valuenone
InheritedNo
Applies To
Animation Type
CSS VersionCSS2
StatusStandard

📝 Syntax

counter-increment: none | <counter-name> <integer>?;

⚙️ Values

ValueTypeDescription
noneKeywordDo not increment
<counter-name> <integer>?ValueCounter name and step

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
counter-increment v1 v12 v1 v1 v1
Supported in all major browsers
Tip: counter-increment only increments; it does not display the value. Pair it with content: counter(name) to output the number on the page.

❓ FAQ

QWhat is the difference between counter-increment and counter-reset?
Acounter-reset creates and initializes a counter (setting its start value, 0 by default), usually declared on the parent container. counter-increment increases the counter each time an element matches (by 1 per match by default), usually written on the elements being numbered. Together with content's counter() function they produce complete automatic numbering.
QHow do I create multi-level numbering like 1.1, 1.2?
AUse two counter levels: an outer counter-reset: chapter plus counter-increment, and an inner counter-reset: section plus counter-increment, then output with content: counter(chapter) "." counter(section);. That yields 1.1-style numbering.
QCan the counter-increment step be something other than 1?
AYes. counter-increment: myCounter 2; increments by 2 each time; omitting the number defaults to 1. You can also increment several counters at once, e.g. counter-increment: a 1 b 2;, and negative values work too. Remember it only changes the counter value — you must output it with counter() in content to see the numbers.
QDo counters get mixed up in nested lists?
ANo. CSS counters are scoped: declaring counter-reset on an element creates a new counter instance that shadows the parent's, so child lists restart from their initial value. For example, each <ol> that resets its counter produces numbering independent of the others. To continue numbering, skip the reset, or use counters() to output the full hierarchical path.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏