CSSPageRule

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.

* Some parts of this feature may have varying levels of support.

CSSPageRule は単一の CSS @page ルールを表します。

CSSRule CSSGroupingRule CSSPageRule

インスタンスプロパティ

祖先である 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

ブラウザーの互換性

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
CSSPageRule
selectorText
style
Type changed to CSSPageDescriptors
Experimental

Legend

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

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.