CSSCounterStyleRule: negative プロパティ

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.

negativeCSSCounterStyleRule インターフェイスのプロパティで、 negative 記述子の値を取得または設定します。この記述子に値が設定されていない場合、この属性は空文字列を返します。

文字列です。

次の例は @counter-style ルールを示しています。 JavaScript では myRules[0] がこの @counter-style ルールであり、 negative を返すと "-" という値が得られます。

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); // "-"

仕様書

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

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
negative

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support