@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.
Quick 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;
} @page Browser Support
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.
Works in all modern browsers. May need a fallback for older browsers.
2+
19+
18.2+
12+