CSSCounterStyleRule:name 属性
Baseline 2023Newly 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
接口的 name
属性用于获取或设置 <custom-ident>
为关联规则定义的 name
。
值
字符串。
示例
以下示例展示了 @counter-style
样式的规则。在 JavaScript 中,myRules[0]
为 @counter-style
规则,name
返回值为自定义标识“box-corner”。
css
@counter-style box-corner {
system: fixed;
symbols: ◰ ◳ ◲ ◱;
suffix: ": ";
fallback: disc;
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].name); // "box-corner"
规范
Specification |
---|
CSS Counter Styles Level 3 # dom-csscounterstylerule-name |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.