This media is not supported in your browser
VIEW IN TELEGRAM
π Modifying Printed Page Layouts with
#css #page
@page#css #page
Sometimes, users need to print web pages on physical papers for offline use. Also, some users print web pages as PDF documents to save for future use. Some web apps offer server-based features to generate paper-friendly PDF documents, but you can also print any web page using the browserβs native printing feature.
The `page` CSS at-rule offers a way to customize page dimensions, orientation, and margins of printed pages without affecting the visible browser viewport. For example, the following CSS snippet sets a 1-inch margin and A4 landscape size for printed pages:
@page {
size: A4 landscape;
margin: 1in;
}This at-rule comes with `:first`, `:blank`, `:left`, and `:right` pseudo-classes to select specific pages of the printed document. Browse the official MDN documentation to learn more details about `page`.
π2