HomeCSS Counter Generator

CSS Counter Generator

Online CSS counter generator for counter-reset/counter-increment auto numbering with prefixes/suffixes and multiple formats, ideal for docs, outlines, and step lists.

Counter Settings

Preview

1.First item
2.Second item
3.Third item

CSS code

body {
  counter-reset: section 1;
}

.item {
  counter-increment: section 1;
}

.item::before {
  content: "" counter(section, decimal) ".";
  margin-right: 0.5em;
  font-weight: bold;
  color: #f59e0b;
}

HTML structure

<div class="item">First item</div>
<div class="item">Second item</div>
<div class="item">Third item</div>
<div class="item">Fourth item</div>


Documentation

About CSS Counter Generator

This tool generates CSS Counter code with configurable name, start value, increment, list style, and prefix/suffix output.

Key Features

  • Counter Setup: Configure counter name, start value, and increment.
  • List Style Modes: Choose numbering formats.
  • Prefix/Suffix: Customize marker wrappers.
  • Live Preview: Inspect numbering output instantly.
  • Code Export: Generate both CSS and sample HTML with copy actions.

Steps

  1. Set counter name, start value, and increment.
  2. Choose list style and marker prefix/suffix.
  3. Check preview output.
  4. Copy CSS/HTML into your page.

Use Cases

  • Custom section/chapter numbering.
  • Branded list markers beyond default list styles.
  • Structured numbering for long-form docs/tutorial pages.

FAQ

Any naming rules for counter names?

Use valid, meaningful identifiers and avoid collisions with existing style names.

Why does preview differ from my page?

Global styles or selector specificity may override generated rules; check scope and cascade order.