CSS3 & Modern Layouts (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
High-Fidelity Print Style Sheets: `@media print` and `@page`.
senior LevelSystem Design
In Simple Words: Print style sheets optimize web pages for printing and PDF generation:
- Hide Navigation & Interactive UI:
display: noneon headers, buttons, footers. - Prevent Breaking Across Pages:
break-inside: avoid(formerlypage-break-inside: avoid) on cards, questions, and tables. - Expand URLs:
a[href]::after { content: " (" attr(href) ")"; }displays destination URLs on physical paper. - Margins:
@page { margin: 1.5cm; }sets physical printer margins.