The print media type lets you apply CSS only when a page is printed or viewed in print preview. Create clean, paper-friendly layouts by hiding chrome and tuning typography.
01
@media
Media query.
02
print
Paper output.
03
Hide UI
Nav & ads.
04
pt units
Print fonts.
05
page-break
Page control.
06
vs screen
Media types.
Fundamentals
Introduction
Screen styles often include dark headers, floating sidebars, and large buttons — great for browsing, wasteful on paper. When users press Ctrl+P (or Cmd+P on Mac), the browser switches to the print media type and applies your print-specific CSS.
Unlike media features such as min-width or pointer, print is a media type that describes the output medium itself.
Definition and Usage
Wrap rules in @media print { } to target printed output. Hide navigation, use readable font sizes in pt, set black text on white backgrounds, and control page breaks for long articles.
💡
Beginner Tip
Print styles do not appear on the normal screen. Always test with the browser’s Print Preview (Ctrl+P) to see your @media print rules in action.
Foundation
📝 Syntax
Use the print keyword as the media type:
syntax.css
@mediaprint{/* Styles for printed output only */}/* Shorthand — same as above */@mediaprint{.no-print{display:none;}}
Common Media Types
screen — Computer and phone displays (the default browsing context).
print — Printed pages and print preview.
all — All media types (use sparingly).
speech — Screen readers and speech synthesizers.
print vs screen
@media screen { } Styles for monitors and phone displays. This is the default when no media type is specified in many contexts.
@media print { } Styles for paper output and print preview. Hides UI chrome and optimizes readability.
print vs overflow-block: paged
@media print Media type — targets the print output medium directly. The most common approach.
@media (overflow-block: paged) Media feature — matches when block-axis overflow is paginated. Complements print styles.
Printed pages cannot be clicked. Showing URLs after links is a classic print-friendly pattern.
Tips
🛠 Usage Tips
Test with Print Preview — Always verify with Ctrl+P before shipping print styles.
Use pt for fonts — 12pt body and 14–18pt headings read well on paper.
Strip backgrounds — Save ink by removing dark backgrounds and box shadows.
no-print utility — One reusable class is easier than many one-off selectors.
Combine with @page — Set margins with @page { margin: 2cm; } inside print blocks.
Watch Out
⚠️ Common Pitfalls
Expecting screen preview — Print styles only appear in Print Preview, not on the normal page.
Calling it a property — print is a media type, not a CSS property.
Printing dark themes — Dark backgrounds waste ink and reduce contrast on paper.
Forgetting buttons — Hide interactive controls that are useless on paper.
Absolute positioning — Fixed and sticky elements often print incorrectly; hide or reset them.
A11y
♿ Accessibility
Readable contrast — Black on white provides the best print legibility.
Do not rely on color alone — Printed pages are often grayscale; use text labels too.
Preserve content — Hide chrome, not the main article or data users need.
Link URLs — Show href values so printed references remain useful.
Font size — Avoid fonts smaller than 10pt for body text.
🧠 How print Works
1
User opens Print Preview
Ctrl+P switches the rendering context to the print media type.
Trigger
2
Browser applies @media print
Print-only rules override screen styles for paper layout.
Match
3
Page breaks and margins apply
Content flows across pages with your break and typography rules.
Layout
=
🖨
Clean printout
Professional paper output without wasted ink or broken layouts.
Compatibility
🖥 Browser Compatibility
The print media type has universal support — it has been part of CSS since the earliest media query specifications.
✓ Baseline · Universal support
Print media queries
Works in every browser including Chrome, Firefox, Safari, Edge, and Opera.
99%Global support
print media type99% supported
Bottom line:@media print is one of the safest CSS features to use in production. Always verify visually in Print Preview.
Wrap Up
🎉 Conclusion
The print media type is essential for professional web content. With @media print, you hide navigation, tune typography for paper, and control page breaks so printed pages look intentional.
Test every print stylesheet in Print Preview (Ctrl+P). Pair with overflow-block for advanced paginated layouts when needed.
Use these points when building printer-friendly pages.
5
Core concepts
P01
Media type
Not a feature.
Concept
Ctrl02
Print Preview
Ctrl+P to test.
Testing
1203
12pt body
Print fonts.
Typography
X04
Hide chrome
Nav & ads.
Pattern
BR05
Page breaks
Avoid splits.
Layout
FAQ
❓ Frequently Asked Questions
What does the CSS print media type do?
The print media type targets printed output. Rules inside @media print { } apply when the document is printed or viewed in print preview (Ctrl+P). Use it to hide navigation, adjust fonts for paper, and control page breaks.
How is print different from a media feature?
print is a media type that describes the output medium (paper). Media features like min-width or pointer describe device capabilities. You can combine them: @media print and (min-width: 8in) { }.
What should I hide when printing a webpage?
Hide navigation bars, sidebars, ads, buttons, cookie banners, and decorative backgrounds. Keep the main article content, headings, and essential data visible.
How do I test print styles?
Open your browser print preview with Ctrl+P (Windows) or Cmd+P (Mac). Chrome, Firefox, Safari, and Edge all render @media print rules in the preview before you print.
Is @media print widely supported in browsers?
Yes. The print media type has been supported in all browsers for decades. It is one of the most reliable CSS media queries for production use.