CSSCounterStyleRule:fallback 属性
>CSSCounterStyleRule 接口的 fallback 属性用于获取或设置 fallback 描述符的值。如果描述符没有设置值,此属性返回空字符串。
值
字符串。
示例
以下示例展示了 @counter-style 样式的规则。在 JavaScript 中,myRules[0] 为 @counter-style 规则,fallback 返回值为“disc”。
css
@counter-style box-corner {
system: fixed;
symbols: ◰ ◳ ◲ ◱;
suffix: ": ";
fallback: disc;
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].fallback); // "disc"
规范
| 规范 |
|---|
| CSS Counter Styles Level 3> # dom-csscounterstylerule-fallback> |