← Back to at-rules
CSS At-rule
@page
PrintModifies the margins, orientation, and size of printed pages.
Syntax
@page { margin: value; }Example
@page { margin: 2cm; size: A4 landscape; }Common use cases
- Setting print margins
- Landscape vs portrait page orientation
- Page-specific styles for PDF generation
Practical developer insight
@page only applies when printing or generating PDFs — combine with @media print to control the full print experience.