Build a web page that prints cleanly
8 steps · about 3 h 55 min · Intermediate
- Start with semantic structure (guide, MDN Web Docs, 30 min)
Give headings, sections, tables and navigation meaningful roles before changing presentation.
- Mark self-contained content (reference, MDN Web Docs, 25 min)
Group the document's main reusable unit independently from surrounding site controls.
- Create print-specific rules (guide, MDN Web Docs, 35 min)
Apply a print media query and test it without disturbing the screen layout.
- Set page dimensions and margins (reference, MDN Web Docs, 30 min)
Control the page box while allowing for printer and PDF output constraints.
- Manage major page breaks (reference, MDN Web Docs, 30 min)
Start important sections predictably without filling the document with manual spacer elements.
- Keep units together (reference, MDN Web Docs, 25 min)
Reduce awkward splits inside figures, code samples, tables and compact content blocks.
- Control stranded lines (reference, MDN Web Docs, 25 min)
Avoid leaving too few paragraph lines at the bottom or top of a printed page.
- Preview and export the result (guide, MDN Web Docs, 35 min)
Check hidden controls, expanded link destinations, contrast, breaks and PDF text selection before release.