Cookies improve the way our website works, by using this website you are agreeing to our use of cookies. For more information see our privacy policy.
OK
Allows to define attributes for the page in paged media, such as print previews and printed pages.
Note: The @page rule is supported in Internet Explorer from version 8.
The @page rule specifies the margins and dimensions of the printed pages.
In Javascript, the cssRules collection contains the CSS rules of a style sheet, and the CSSPageRule object represents a @page rule.
The cssRules collection does not contain the @page rules in Firefox and Safari before version 5, and it is not supported in Internet Explorer before version 9.
If you want to get the @page rules in older Internet Explorer versions, use the pages collection.
There is no way to access to a @page rule in Firefox and in older versions of Safari.
Syntax:
@page [pageSelector][pseudoClass] { rules
}
pageSelector
-
Optional. Selector to specific pages. Not supported in Internet Explorer.
/*
This page rule is not supported in Internet Explorer,
because it uses a page selector (myPage).
*/@pagemyPage:right {
margin-left: 2cm;
margin-right: 3cm;
}