CSSPageRule.selectorText
selectorText
は CSSPageRule
インターフェイスのプロパティで、この CSSPageRule
に関連付けられたセレクターを取得および設定します。
値
文字列で宇s。
例
このスタイルシートは 2 つの @page
ルールを含んでいます。 selectorText
プロパティは、:first
のセレクターテキストを文字列として返します。
css
@page {
margin: 1cm;
}
@page :first {
margin: 2cm;
}
js
let myRules = document.styleSheets[0].cssRules; // 2 つの myRules を返す
console.log(myRules[1].selectorText); // ":first" という文字列を返す
仕様書
Specification |
---|
CSS Object Model (CSSOM) # dom-csspagerule-selectortext |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
selectorText |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.