symbols CSS at-rule descriptor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The symbols CSS descriptor of the @counter-style at-rule is used to specify the symbols for creating counter representations in the specified counter system. Specifying this descriptor is mandatory when the value of the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed.

Syntax

css
symbols: A B C D E;
symbols: "\24B6" "\24B7" "\24B8" D E;
symbols: "0" "1" "2" "4" "5" "6" "7" "8" "9";
symbols: url("one.svg") url("two.svg") url("three.svg");
symbols: indic-numbers;

Values

The symbols descriptor is specified as a list of one or more space-separated <symbol> values.

<symbol>

Specifies the symbol to use within the counter system. Each symbol in the list can be either a <string>, an <image>, or a <custom-ident>. The <image> value can, in turn, be specified as a <url> or <gradient>.

Note: When using an identifier for a symbol, note that ASCII non-letters such as *, ", and \ are not considered identifiers. They must be either quoted as a string or escaped.

Description

A symbol can be a string, image, or identifier. It is used within the @counter-style at-rule.

When the value of the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed, the symbols descriptor must be specified. For the additive system, use the additive-symbols descriptor instead to specify the symbols.

While a space between quoted symbols is not required, it makes CSS more readable. To use a quote as a symbol, either escape the quote character or enclose the character within different quotes, such as "'".

When defining symbols with identifiers instead of strings, be sure to use identifier syntax rules. For example, as noted above, ASCII non-letters such as * are not identifiers and must be either quoted or escaped. Hex escape characters are followed by a space. This space may look like the space separating two identifiers, but it enables digits to follow hex-escaped characters. This means that two spaces must be included after a hex-escaped identifier to separate it from the next identifier. For example, it is better to use the string "\2A 1" instead of \2A 1 with two spaces, as your code tools might remove double spaces. It is generally safer to quote identifiers that need to be escaped or use strings.

Formal definition

Related at-rule@counter-style
Initial valuen/a (required)
Computed valueas specified

Formal syntax

symbols = 
<symbol>+

<symbol> =
<string> |
<image> |
<custom-ident>

<image> =
<url> |
<image()> |
<image-set()> |
<cross-fade()> |
<element()> |
<gradient>

<image()> =
image( <image-tags>? [ <image-src>? , <color>? ]! )

<image-set()> =
image-set( <image-set-option># )

<cross-fade()> =
cross-fade( <cf-image># )

<element()> =
element( <id-selector> )

<image-tags> =
ltr |
rtl

<image-src> =
<url> |
<string>

<image-set-option> =
[ <image> | <string> ] [ <resolution> || type( <string> ) ]?

<cf-image> =
[ <image> | <color> ] &&
<percentage [0,100]>?

<id-selector> =
<hash-token>

Examples

Setting counter symbols

In this example, the list of values for the symbols descriptor include letters (A, D, E), a number within quotes ("1"), and a hex-escape identifier within quotes ("\24B7") for the character Ⓑ.

HTML

html
<ul class="list">
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
  <li>Four</li>
  <li>Five</li>
</ul>

CSS

css
@counter-style symbols-example {
  system: fixed;
  symbols: A "1" "\24B7" D E;
}

.list {
  list-style: symbols-example;
}

Result

Specifications

Specification
CSS Counter Styles Level 3
# counter-style-symbols

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
symbols
Chrome – Partial support
Chrome 91 (Release date: 2021-05-25)
footnote Partial support
footnote Does not support <image> as a value for the symbols descriptor.
Edge – Partial support
Edge 91 (Release date: 2021-05-27)
footnote Partial support
footnote Does not support <image> as a value for the symbols descriptor.
Firefox – Partial support
Firefox 33 (Release date: 2014-10-14)
footnote Partial support
footnote Does not support <image> as a value for the symbols descriptor.
Opera – Partial support
Opera 77 (Release date: 2021-06-09)
footnote Partial support
footnote Does not support <image> as a value for the symbols descriptor.
Safari – Full support
Safari 17 (Release date: 2023-09-18)
footnote Full support
Chrome Android – Partial support
Chrome Android 91 (Release date: 2021-05-25)
footnote Partial support
footnote Does not support <image> as a value for the symbols descriptor.
Firefox for Android – Partial support
Firefox for Android 33 (Release date: 2014-10-14)
footnote Partial support
footnote Does not support <image> as a value for the symbols descriptor.
Opera Android – Partial support
Opera Android 64 (Release date: 2021-05-25)
footnote Partial support
footnote Does not support <image> as a value for the symbols descriptor.
Safari on iOS – Full support
Safari on iOS 17 (Release date: 2023-09-18)
footnote Full support
Samsung Internet – Partial support
Samsung Internet 16 (Release date: 2021-11-25)
footnote Partial support
footnote Does not support <image> as a value for the symbols descriptor.
WebView Android – Partial support
WebView Android 91 (Release date: 2021-05-25)
footnote Partial support
footnote Does not support <image> as a value for the symbols descriptor.
WebView on iOS – Full support
WebView on iOS 17 (Release date: 2023-09-18)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support

See also