Hide chrome
Navigation, buttons and sticky UI usually do not belong on paper.
Print CSS prepares a page for paper, PDFs and browser print dialogs. It strips noise and preserves useful content.
@media print {
nav, .button { display: none; }
body { background: white; color: black; }
}
Production mental model
Users still print pages, save PDFs, share course notes and keep invoices or checklists. A screen design rarely prints well by accident.
Print CSS lets you remove navigation, heavy backgrounds, sticky elements and decorative motion while keeping headings, text, links and useful details.
Good print CSS is not about making paper beautiful first. It is about making paper readable and complete.
Navigation, buttons and sticky UI usually do not belong on paper.
Printed links should reveal their destination when useful.
Avoid splitting important blocks awkwardly.
Remove dark backgrounds and heavy decorative color.
Visual model
Navigation, buttons and dark surfaces support interaction.
CSS switches to paper-friendly rules.
Text and headings remain clear.
The result works outside the browser.
Good CSS versus fragile CSS
@media print {
nav, .button, .sidebar { display: none; }
body { background: white; color: black; }
a[href]::after { content: " (" attr(href) ")"; }
article { break-inside: avoid; }
}
body { background: #07111f; color: white; }
.hero { min-height: 100vh; }
.sticky-nav { position: sticky; top: 0; }
Rules of thumb
Buttons, nav bars, sticky controls and forms often print as clutter.
White paper and black text are often the cleanest baseline.
Printed links need visible destinations when the link matters.
Use break-inside and break-before to keep important blocks together.
Screen drama can waste an entire printed page.
Use the browser print preview before claiming it works.
Production thinking
Print CSS respects a different use case: reading, archiving and sharing content outside the interactive website.
Readable print output helps people who prefer paper, PDFs, larger text or offline review.
At minimum, test print output for course lessons, invoices, legal pages, documentation and checklists.
Print CSS does not rank directly, but useful documents improve trust and content quality.
Live code lab
The preview runs in an isolated iframe. Links and forms stay inside the practice area, so you can experiment without leaving the lesson.
Mini assignment
Practice assignment
Try it yourself
Self-check
Answer these questions before moving on. Production CSS is not about writing more rules; it is about proving the rules survive real use.
Senior audit upgrade
Printing is its own output mode. Use @page, break rules and URL hints when the content may be printed or saved as PDF.
Control print margins where supported.
Use break-before, break-after and break-inside to avoid ugly splits.
For printed documents, consider showing link URLs after link text.
@media print {
a[href]::after { content: ' (' attr(href) ')'; }
.card { break-inside: avoid; }
}
@page { margin: 16mm; }