Build a web page that prints cleanly

8 steps · about 3 h 55 min · Intermediate

  1. Start with semantic structure (guide, MDN Web Docs, 30 min)

    Give headings, sections, tables and navigation meaningful roles before changing presentation.

  2. Mark self-contained content (reference, MDN Web Docs, 25 min)

    Group the document's main reusable unit independently from surrounding site controls.

  3. Create print-specific rules (guide, MDN Web Docs, 35 min)

    Apply a print media query and test it without disturbing the screen layout.

  4. Set page dimensions and margins (reference, MDN Web Docs, 30 min)

    Control the page box while allowing for printer and PDF output constraints.

  5. Manage major page breaks (reference, MDN Web Docs, 30 min)

    Start important sections predictably without filling the document with manual spacer elements.

  6. Keep units together (reference, MDN Web Docs, 25 min)

    Reduce awkward splits inside figures, code samples, tables and compact content blocks.

  7. Control stranded lines (reference, MDN Web Docs, 25 min)

    Avoid leaving too few paragraph lines at the bottom or top of a printed page.

  8. 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.