@page

An at-rule used to apply styles specifically to printed pages. It lets you set things like page margins, size, and orientation for the whole document.

/* Usage Example */
@page {
  /* Sets a 1-inch margin for all pages when printing */
  margin: 1in;
  size: portrait;
}
@page :first{
  /* Specialized margins for only the first page */
  margin-top: 2in;
}
Newly available Since 2024 93% global usage

Since 2024 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

2+
19+
18.2+
12+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC