CKTIS / CSS
counter-increment — changing counter values
`counter-increment` changes named CSS counters by a specified integer. Display the result using `counter()` in generated content.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
counter-increment: none | [ <counter-name> <integer>? ]+;counter-increment adds an integer to a counter; the default is 1. Zero and negative values are allowed. Separate multiple name–integer pairs with spaces, not commas.
The initial value is none; the property is not inherited. A missing counter starts at 0 before incrementing. counter-reset creates a counter, whereas counter-set assigns its value instead of adding.
Changing a counter does not display it: use counter() in content. none neither resets counters nor disables automatic list-item numbering; stop that increment with counter-increment: list-item 0;.
Examples
<!doctype html>
<meta charset="utf-8">
<title>counter-increment</title>
<style>
.steps { counter-reset: step 0; }
.steps p { counter-increment: step 2; }
.steps p::before { content: counter(step) ". "; }
</style>
<div class="steps">
<p>Alpha</p>
<p>Beta</p>
<p>Gamma</p>
</div>Result
2. Alpha 4. Beta 6. Gamma
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.