CSSCounterStyleRule: negative 属性
CSSCounterStyleRule 接口的 negative 属性用于获取和设置 negative 描述符的值。如果未设置该描述符的值,则此属性返回一个空字符串。
值
字符串。
示例
以下示例显示了一个 @counter-style 规则。在 JavaScript 中,myRules[0] 就是这个 @counter-style 规则,返回 negative 会得到值 "-"。
css
@counter-style neg {
system: numeric;
symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
negative: "-";
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].negative); // "-"
规范
| 规范 |
|---|
| CSS Counter Styles Level 3 # dom-csscounterstylerule-negative |
浏览器兼容性
加载中…