CSSCounterStyleRule: suffix プロパティ
Baseline
広く利用可能
この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2023年9月以降、すべてのブラウザーで利用可能です。
suffix は CSSCounterStyleRule インターフェイスのプロパティで、 suffix 記述子の値を取得または設定します。この記述子に値が設定されていない場合、この属性は空文字列を返します。
値
文字列です。
例
次の例は @counter-style ルールを示しています。 JavaScript では myRules[0] がこの @counter-style ルールであり、 suffix を返すと ": " という値が得られます。
css
@counter-style box-corner {
system: fixed;
symbols: ◰ ◳ ◲ ◱;
suffix: ": ";
negative: "-";
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].suffix); // ": "
仕様書
| 仕様書 |
|---|
| CSS Counter Styles Level 3> # dom-csscounterstylerule-suffix> |