CSS @counter-style with Emojis
21 March 2024
Updated: 08 April 2024
The CSS @counter-style
rule is used for defining list-styles in CSS
The syntax is pretty simple:
Currently
symbols
just supports strings, but once fully supported it will also be possible to use images as symbols
Cyclic Counter Style
For the sake of example, I’ll be using Emojis as the symbols to display. We can define a cycle which uses some emojis like so:
- Item 1
- Item 2
- Item 3
- Item 4
- Item 5
- Item 7
- Item 8
- Item 9
- Item 10
Numeric Counter Style
For this example, we’ll use emoji numbers for the counter style
- Item 1
- Item 2
- Item 3
- Item 4
- Item 5
- Item 11
- Item 12
- Item 13
- Item 14
- Item 15
- Item 111
- Item 112
- Item 113
- Item 114
- Item 115