CSSPageRule.style

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.

styleCSSPageRule インターフェイスの読み取り専用プロパティで、 CSSStyleDeclaration オブジェクトを返します。これは CSS 宣言ブロックであるオブジェクトを表し、スタイル情報や様々なスタイル関係のメソッドとプロパティを公開します。

CSSStyleDeclaration オブジェクトで、 CSS 宣言ブロックを以下のプロパティで表します。

computed flag

未設定。

declarations

ルール内で宣言された宣言は、指定された順に、一括指定プロパティを個別指定に展開されます。

parent CSS rule

コンテキストオブジェクト、すなわち this の別名です。

owner node

Null です。

このスタイルシートは @page ルールを含んでいます。ルールのリストを取得し、 style プロパティの値を返すと、CSSStyleDeclaration オブジェクトが返されます。

css
@page {
  margin: 1cm;
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].style); // CSSStyleDeclaration オブジェクトを返す

仕様書

Specification
CSS Object Model (CSSOM)
# dom-csspagerule-style

ブラウザーの互換性

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
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.