The fallback
descriptor can be used to specify a counter style to fall back to if the current counter style cannot create a marker representation for a particular counter value. If the specified fallback style is also unable to construct a representation, then its fallback style will be used. If a valid fallback style is not specified, it defaults to decimal
.
A couple of scenarios where a fallback style will be used are:
range
descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range.fixed
system
is used and there are not enough symbols to cover all the list items, the fallback style will be used for the rest of the list items.Related at-rule | @counter-style |
---|---|
Initial value | decimal |
Media | all |
Computed value | as specified |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
/* Keyword values */ fallback: lower-alpha; fallback: custom-gangnam-style;
<counter-style-name>where
<counter-style-name> = <custom-ident>
<ulclass="list"><li>One</li><li>Two</li><li>Three</li><li>Four</li><li>Five</li></ul>
@counter-style fallback-example { system: fixed; symbols: "\24B6" "\24B7" "\24B8"; fallback: upper-alpha; } .list { list-style: fallback-example; }
Specification | Status | Comment |
---|---|---|
CSS Counter Styles Level 3 The definition of 'fallback' in that specification. | Candidate Recommendation | Initial definition |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | No | ? | 33 | No | No | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | No | ? | ? | 33 | No | No | No |
list-style
, list-style-image
, list-style-position
symbols()
: the functional notation creating anonymous counter styles
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/@counter-style/fallback