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

Specification Status Comment
CSS Object Model (CSSOM)
The definition of 'CSSPageRule.style' in that specification.
Working Draft No changes from Document Object Model (DOM) Level 2 Style Specification
Document Object Model (DOM) Level 2 Style Specification
The definition of 'CSSPageRule' in that specification.
Obsolete Initial definition

Browser compatibility

BCD tables only load in the browser