A print stylesheet applies rules when the document is printed or previewed for print. It changes presentation; it does not validate the record or create a PDF archive policy.
CSS print styles: preserve the record and remove screen-only controls
How the rule works
An incident report should print with its case number, finding, and source links in readable order. Navigation controls and floating action bars can be hidden, while the article stays visible and breaks across pages sensibly. A link's destination may not be obvious on paper, so important references need readable text in the document itself. Background colors may be omitted by the printer; use black text and borders where needed. Test print preview with long tables and more than one page, not just the first sheet.
@media print {
.site-navigation, .report-actions { display: none; }
.incident-report { color: #000; background: #fff; max-inline-size: none; }
.incident-report h2 { break-after: avoid; }
.incident-report table { break-inside: auto; }
}Cost and verification
Print rules add CSS bytes but no extra request when kept in the main stylesheet. The bigger cost is maintaining a second rendering context and testing page breaks. Do not hide a link list if it is the only record of supporting documents. Print preview is not proof that a later printer or PDF pipeline preserves colors and margins; check the final output when the report is operationally important.
Common Mistakes
- Do not hide evidence merely because it is awkward to print.
- Do not depend on background color to mark a held case on paper.
- Do not assume one-page preview proves multi-page tables are readable.
Connected lessons
- CSS Interaction and Accessibility
- HTML print stylesheet: declare a separate rendering context
- CSS readable type: set measure and rhythm before decorative details
- HTML incident evidence project: keep a record readable when video fails
Extend this decision
- CSS multi-column layout: fragment long text without breaking meaning
- CSS audit table project: responsive records without dropped columns
