@page CSS At-Rule


The @page CSS at-rule allows you to set the value of fields when printing a document or for pages whose media type is set to print. You can only change the margins, orphans, widows, and page breaks of the document. Attempts to change any other CSS properties will be ignored.


@page :pseudo-selector {
    /* margins, widows, orphans, and/or page break styles */


  • sizeSpecifies the target size and orientation of the page box’s containing block. In the general case, where one page box is rendered onto one page sheet, it also indicates the size of the destination page sheet.
  • marksAdds crop and/or registration marks to the document.
  • bleedSpecifies the extent beyond the page box at which the page rendering is clipped.


@page: left {
margin-left: 4cm;
margin-right: 2cm;
@page: right {
margin-left: 2cm;
margin-right: 4cm;

Browser Support

Explorer Edge Chrome Firefox Opera Safari
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung

Last updated by CSSPortal on: 1st December 2019