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.
/* Keyword values */ fallback: lower-alpha; fallback: custom-gangnam-style;
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.
| 相关 at-rule |
@counter-style
|
|---|---|
| 初始值 |
decimal
|
| 计算值 | 如指定 |
<counter-style-name>where
<counter-style-name> = <custom-ident>
<ul class="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;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Counter Styles Level 3
The definition of 'fallback' in that specification. |
候选推荐 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
fallback
|
Chrome 不支持 No | Edge 不支持 No | Firefox 完整支持 33 | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 完整支持 33 | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
完整支持
不支持
list-style
,
list-style-image
,
list-style-position
symbols()
: the functional notation creating anonymous counter styles