CSSPageRule
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
* Some parts of this feature may have varying levels of support.
CSSPageRule は単一の CSS @page ルールを表します。
インスタンスプロパティ
祖先である CSSRule からプロパティを継承しています。
CSSPageRule.selectorText-
このアットルールに関連付けられたページセレクターのテキストを表します。
CSSPageRule.style読取専用-
このアットルールに関連付けられた宣言ブロックを返します。
インスタンスメソッド
祖先である CSSRule からメソッドを継承しています。
例
このスタイルシートには単一の @page ルールがあるので、最初の(そして唯一の)返されるルールは CSSPageRule になります。
css
@page {
margin: 1cm;
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0]); // CSSPageRule
仕様書
| Specification |
|---|
| CSS Object Model (CSSOM)> # the-csspagerule-interface> |
ブラウザーの互換性
Loading…