CSSCounterStyleRule: negative-Eigenschaft
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.
Die negative-Eigenschaft der CSSCounterStyleRule-Schnittstelle ruft den Wert des negative-Descriptors ab und setzt ihn. Wenn der Descriptor keinen Wert gesetzt hat, gibt dieses Attribut einen leeren String zurück.
Wert
Ein String.
Beispiele
Das folgende Beispiel zeigt eine @counter-style-Regel. In JavaScript ist myRules[0] diese @counter-style-Regel. Die Rückgabe von negative liefert uns den Wert "-".
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); // "-"
Spezifikationen
| Specification |
|---|
| CSS Counter Styles Level 3> # dom-csscounterstylerule-negative> |
Browser-Kompatibilität
Loading…