symbols() CSS Function
The symbols() function defines an anonymous counter style inline, for list markers, without an @counter-style rule.
Description
The symbols() CSS function defines an anonymous counter style inline, directly where it is used, without a separate @counter-style rule. It can be used as a value of list-style-type (and the list-style shorthand), and as the style argument of counter() and counters().
The first, optional argument is the counter system, which decides how the symbols are used. cyclic (the default for this function) repeats the symbols in a loop. numeric treats them as digits of a number system, so symbols(numeric "0" "1") counts in binary. alphabetic works like lettered lists (a, b, ... z, aa, ab). symbolic repeats the symbol more each time round (*, **, ***). fixed uses each symbol once and then falls back to decimal numbers. The symbols themselves are strings or images.
Counter styles made with symbols() have no prefix and use a single space as the suffix. For reusable styles, or to control the suffix, prefix, range and padding, define a named style with @counter-style instead.
/* Repeating custom bullets */
ul.stars {
list-style: symbols(cyclic "\2605" "\2606"); /* filled and empty stars */
}
/* Binary numbering */
ol.binary {
list-style: symbols(numeric "0" "1");
}
/* In generated content */
h2::before {
content: counter(section, symbols(alphabetic "A" "B" "C")) ". ";
}
Syntax
symbols() = symbols( <symbols-type>? [ <string> | <image> ]+ )
<symbols-type> = cyclic | numeric | alphabetic | symbolic | fixed
Values
- cyclicDefault. Cycles through the symbols repeatedly.
- numericTreats the symbols as digits of a place-value number system. At least two symbols are needed.
- alphabeticTreats the symbols as letters of an alphabet (a ... z, aa, ab ...). At least two symbols are needed.
- symbolicCycles through the symbols, doubling, tripling and so on each time round.
- fixedUses each symbol once, then falls back to decimal numbering.
- <string> | <image>The symbols to use, as quoted strings or images.
Example
Browser Support
The following information will show you the current browser support for the CSS symbols() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
Desktop





Tablets & Mobile





