CSSPageRule.style

The style read-only property of the CSSPageRule interface returns a CSSStyleDeclaration object. This represents an object that is a CSS declaration block, and exposes style information and various style-related methods and properties.

Syntax

var style = CSSPageRule.style;

Value

A CSSStyleDeclaration object, which represents a CSS declaration block with the following properties:

computed flag

Unset.

declarations

The declared declarations in the rule, in the order they were specified, shorthand properties expanded to longhands.

parent CSS rule

The context object, which is an alias for this.

owner node

Null.

Examples

The stylesheet includes a @page rule. Getting a list of rules, then returning the value of the style property will return a CSSStyleDeclaration object.

@page {
  margin: 1cm;
}
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].style); // returns a CSSStyleDeclaration object

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
style
1
12
12
9
≤12.1
3
1
18
14
≤12.1
1
1.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CSSPageRule/style