CSSCounterStyleRule: name 屬性
CSSCounterStyleRule 介面的 name 屬性用於獲取和設定與規則關聯的、定義為 name 的 <custom-ident>。
值
字串。
示例
以下示例顯示了一個 @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"
規範
| 規範 |
|---|
| CSS Counter Styles Level 3 # dom-csscounterstylerule-name |
瀏覽器相容性
載入中…