Create a print-ready invoice
Structure an invoice for readable screen, print, and PDF output with controlled page breaks.Description
Requirements
Use a main region and a labelled invoice article with a single descriptive h1.
Represent seller and bill-to contact details in separately labelled address elements.
Use a captioned table with semantic headers for description, quantity, rate, and amount.
Expose subtotal, tax, and total as labelled values, with the total visually and semantically prominent.
Define @media print rules and printed-page margins with @page.
Hide .screen-controls and unrelated navigation in print without hiding invoice content.
Avoid breaking line-item rows, address blocks, and the complete totals summary across pages.
Use high-contrast print colors, readable physical sizing, and repeating table headers.
Printed output
Print the invoice from a page that includes navigation and a Print invoice button
Only the invoice prints with page margins and readable black text
Application controls are useful on screen but not part of the document.
Long invoice
Enough line items to span two pages
Table headings repeat and no item or totals block is split awkwardly
Print fragmentation rules protect meaningful units.
Constraints
Do not render the invoice as an imageKeep monetary values as selectable textDo not depend on JavaScript for print layout
Hints
Hint 1
Start with semantic screen markup; most of it should remain valid for print unchanged.
Hint 2
Use break-inside and legacy page-break-inside fallbacks on indivisible blocks.
Hint 3
Let the table header group repeat naturally instead of recreating headings per page.