Skip to main content
CSS-Tricks
  • Articles
  • Notes
  • Links
  • Guides
  • Almanac
  • Picks
  • Shuffle
Search

Articles Tagged
counters

8 Articles
Direct link to the article Styling Counters in CSS
counters lists

Styling Counters in CSS

Going from the most basic ways to style lists directly in HTML to advanced customization techniques that are even capable of making things that aren't lists look like lists.
Juan Diego Rodríguez on May 7, 2025
Direct link to the article symbols()
counters

symbols()

Defines an only-use counter style without the need to do a whole @counter-style, at the cost of missing some features.
Juan Diego Rodríguez on Jan 30, 2025
Direct link to the article Animating Number Counters
@property calc content counters keyframes

Animating Number Counters

Number animation, as in, imagine a number changing from 1 to 2, then 2 to 3, then 3 to 4, etc. over a specified time. Like a counter, except controlled by the same kind of animation that we use for …

Carter Li on Oct 9, 2020
Direct link to the article Displaying the Current Step with CSS Counters
counter-increment counters

Displaying the Current Step with CSS Counters

Say you have five buttons. Each button is a step. If you click on the fourth button, you’re on step 4 of 5, and you want to display that.

This kind of counting and displaying could be hard-coded, but that’s …

Jan Enning on Jul 17, 2020
Direct link to the article How to Reverse CSS Custom Counters
counter-increment counters lists

How to Reverse CSS Custom Counters

I needed a numbered list of blog posts to be listed with the last/high first and going down from there. Like this:

5. Post Title
4. Post Title
3. Post Title
2. Post Title
1. Post Title

But the above …

Etinosa Obaseki on Jun 11, 2020
Direct link to the article Using CSS Counters for Custom List Number Styling
counters lists marker

Using CSS Counters for Custom List Number Styling

How about a classic CSS trick! Getting custom styling on lists isn’t even so tricky anymore, since CSS counters have introduced counter-increment and counter-reset, and that is perfect for this. I just wanted to make sure you knew how …

Chris Coyier on Jan 26, 2022
Direct link to the article Counting With CSS Counters and CSS Grid
counters grid

Counting With CSS Counters and CSS Grid

In this post, we're going to demonstrate how we can use the source order independence of CSS Grid to solve a layout issue that's the result of a source order constraint. Specifically, we're going to look at checkboxes and CSS Counters—two concepts that rely on source order when used together.

Preethi on Feb 9, 2018
Direct link to the article counter-increment
counter-increment counters lists

counter-increment

Ordered lists aren’t the only elements that can be automatically numbered. Thanks to the various counter-related properties, any element can be.

<body<section</section<section</section<section</section<section</section</body
body {
  counter-reset: my-awesome-counter;
}
section {
  counter-increment: my-awesome-counter;
…
Sara Cope on Apr 19, 2025

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
  • Advertise with us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top