CSSCounterStyleRule:additiveSymbols 属性

Baseline 2023

Newly available

Since September 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

CSSCounterStyleRule 接口的 additiveSymbols 属性用于获取或设置 additive-symbols 描述符的值。如果描述符没有设置值,此属性返回空字符串。

一个字符串。

示例

以下示例展示了 @counter-style 样式的规则。在 JavaScript 中,myRules[0]@counter-style 规则,additiveSymbols 返回值为“ V 5, IV 4, I 1”。

css
@counter-style additive-symbols-example {
  system: additive;
  additive-symbols:
    V 5,
    IV 4,
    I 1;
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].additiveSymbols); // " V 5, IV 4, I 1"

规范

Specification
CSS Counter Styles Level 3
# dom-csscounterstylerule-additivesymbols

浏览器兼容性

BCD tables only load in the browser