CSSPageDescriptors

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The CSSPageDescriptors interface represents a CSS declaration block for an @page at-rule.

The interface exposes style information and various style-related methods and properties for the page. Each multi-word property has versions in camel- and snake-case. This means, for example, that you can access the margin-top CSS property using the syntax style["margin-top"] or style.marginTop (where style is a CSSPageDescriptor).

A CSSPageDescriptors object is accessed through the style property of the CSSPageRule interface, which can in turn be found using the CSSStyleSheet API.

CSSStyleDeclaration CSSPageDescriptors

Instance properties

This interface also inherits properties of its parent, CSSStyleDeclaration.

The following property names, in kebab-case (accessed using bracket notation) and camel-case (accessed using dot notation), each represent the value of a descriptor in the corresponding @page at-rule:

margin

A string representing the margin property of the corresponding @page at-rule.

margin-top or marginTop

A string representing the margin-top property of the corresponding @page at-rule.

margin-right or marginRight

A string representing the margin-right property of the corresponding @page at-rule.

margin-bottom or marginBottom

A string representing the margin-bottom property of the corresponding @page at-rule.

margin-left or marginLeft

A string representing the margin-left property of the corresponding @page at-rule.

page-orientation or pageOrientation

A string representing the page-orientation property of the corresponding @page at-rule.

size

A string representing the size property of the corresponding @page at-rule.

Instance methods

This interface inherits the methods of its parent, CSSStyleDeclaration.

Examples

Inspecting a page at-rule

This example gets the CSSPageDescriptors for a @page at-rule, if the object is supported on the browser, and then logs its properties.

CSS

Below we define styles for the page using a @page at-rule. We assign different values for each margin property using the margin shorthand, and also specify the size. We don't set the page-orientation. This allows us to see how the properties map in the Web API object.

css
@page {
  margin: 1cm 2px 3px 4px;
  /* page-orientation: upright; */
  size: A4;
}

JavaScript

First we check if CSSPageDescriptors is defined on the global window object, and if not we log that the interface is not supported.

If CSSPageDescriptors is supported, we get the target stylesheet, and then gets the cssRules defined in that stylesheet. We need to get this stylesheet because the example is embedded in a separate frame with its own sheet (index 0 is the CSS for this page).

We then iterate through the rules defined for the live example and match any that are of type CSSPageRule, as these correspond to @page rules. For the matching objects we then log the style and all its values.

js
if (typeof window.CSSPageDescriptors === "undefined") {
  log("CSSPageDescriptors is not supported on this browser.");
} else {
  // Get stylesheets for example and then get its cssRules
  const myRules = document.getElementById("css-output").sheet.cssRules;
  for (const rule of myRules) {
    if (rule instanceof CSSPageRule) {
      log(`${rule.style}`);
      log(`margin: ${rule.style.margin}`);

      // Access properties using CamelCase syntax
      log(`marginTop: ${rule.style.marginTop}`);
      log(`marginRight: ${rule.style.marginRight}`);
      log(`marginBottom: ${rule.style.marginBottom}`);
      log(`marginLeft: ${rule.style.marginLeft}`);
      log(`pageOrientation: ${rule.style.pageOrientation}`);

      // Access properties using snake-case syntax
      log(`margin-top: ${rule.style["margin-top"]}`);
      log(`margin-right: ${rule.style["margin-right"]}`);
      log(`margin-left: ${rule.style["margin-left"]}`);
      log(`margin-bottom: ${rule.style["margin-bottom"]}`);
      log(`page-orientation: ${rule.style["page-orientation"]}`);

      log(`size: ${rule.style.size}`);

      // Log the original CSS text using inherited property: cssText
      log(`cssText: ${rule.style.cssText}`);
      log("\n");
    }
  }
}

Results

The results are shown below. Note that the style object displayed at the top of the log should be a CSSPageDescriptors to match the current specification, but may be a CSSStyleDeclaration in some browsers. Note also that the corresponding values for properties in camel- and snake-case match each other and the @page declaration, and that page-orientation is the empty string "" because it is not defined in @page.

Specifications

Specification
CSS Object Model (CSSOM)
# csspagedescriptors

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
CSSPageDescriptors
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
margin
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
margin-bottom
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
margin-left
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
margin-right
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
margin-top
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
marginBottom
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
marginLeft
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
marginRight
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
marginTop
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
page-orientation
Experimental
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
pageOrientation
Experimental
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
size
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 129 (Release date: 2024-08-06)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 129 (Release date: 2024-08-06)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support

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.