@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.
Syntax
/* 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;
}
@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.
2+
19+
18.2+
12+