CSSCounterStyleRule: name-Eigenschaft
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.
Die name
-Eigenschaft der CSSCounterStyleRule
-Schnittstelle erhält und setzt das <custom-ident>
, das als name
für die zugehörige Regel definiert ist.
Wert
Ein String.
Beispiele
Das folgende Beispiel zeigt eine @counter-style
-Regel. In JavaScript ist myRules[0]
diese @counter-style
-Regel, und die Rückgabe von name
liefert uns den benutzerdefinierten Identifikator "box-corner".
@counter-style box-corner {
system: fixed;
symbols: ◰ ◳ ◲ ◱;
suffix: ": ";
fallback: disc;
}
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].name); // "box-corner"
Spezifikationen
Specification |
---|
CSS Counter Styles Level 3 # dom-csscounterstylerule-name |
Browser-Kompatibilität
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