Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a print stylesheet or an @media print block to make a web page easier to read on paper or in a PDF: hide screen-only controls, restore a simple content layout, set page preferences with @page, and manage page breaks. Then check the result in print preview and in the PDF or printer workflow your readers use.

Choose how to organize your print CSS

Both a separate stylesheet and an inline print media block are standards-supported ways to target printing. The choice is mainly about how your project is organized:

Approach Best fit Trade-off
Linked print stylesheet Keep screen and print rules separate, or maintain a print bundle in your build system. Load it after the main stylesheet if its rules need to take precedence. Caching and maintenance depend on how your site serves stylesheets.
Inline @media print block Keep print rules alongside the site’s other CSS. Print rules share the stylesheet and cascade with screen rules, so ordering and specificity still matter.

For a separate file, add a link in the document head:

<link rel="stylesheet" href="/css/print.css" media="print">

Or add print-specific rules to a stylesheet:

@media print {
  /* Print-only rules go here. */
}

The print media type targets paged output, including print preview; MDN’s Printing guide also describes paper and PDF output. The W3C CSS Print Profile says, for conformance to that profile, “The printer SHALL accept and process style sheets that target the print media type.” That statement describes the profile’s requirement, not a guarantee that every browser, driver, or device will render identically.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Brother DCP-L2640DW Wireless Compact Monochrome Multi-Function Printer, Copy, Scan, Duplex, Mobile Printing
  • BEST FOR SMALL BUSINESSES – Engineered for extraordinary productivity, the Brother DCP-L2640DW Monochrome (Black & White) 3-in-1 combines laser printer, scanner, copier in one compact footprint and delivers high-quality black & white prints
  • FAST PRINTER WITH EFFICIENT SCANNING – Produces documents quickly with print speeds up to 36 ppm(2) and scan speeds up to 23.6/7.9 ipm(3) (black/color). A 50-page auto document feeder(4) allows for convenient, time saving multi-page scanning and copying
  • FLEXIBLE CONNECTION OPTIONS – Easily navigate the changing demands of your business with secure multi-device connectivity via built-in dual-band wireless (2.4GHz / 5GHz) and Ethernet. Or connect locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Print, scan, and manage your wireless printer anytime, from almost anywhere from your mobile device. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(5)
  • CHOOSE BROTHER GENUINE TONER – When it’s time to replace your toner, be sure to choose Brother Genuine TN830 or TN830XL replacement toner. And with Refresh EZ Print Subscription Service, you’ll never worry about running out of toner again and you’ll enjoy savings of up to 50%(6) on Brother Genuine Toner. Get started with Refresh today with a Free Trial(1)

Hide controls, not useful content

Remove elements that only help someone navigate or interact with the screen page, such as site navigation, cookie banners, ads, and buttons. Keep the article’s content and structure, meaningful images, and links.

@media print {
  header,
  nav,
  footer,
  .site-tools,
  .cookie-banner,
  .ad,
  button {
    display: none !important;
  }
}

Replace these example selectors with ones that match your page. Avoid hiding a broad element if it also contains the main content: a rule that removes the wrong header or footer, for example, can discard information a reader needs. Use print rules late enough in the stylesheet to override conflicting screen declarations; if a rule still loses, inspect selector specificity and the cascade.

Reset the layout for a printed page

Screen layouts often rely on constrained widths, decorative backgrounds, overlays, or fixed-position controls. In print, favor normal document flow, readable type, and a content area that can use the page width. For example:

Rank #2
Brother HL-L2405W Wireless Compact Monochrome Laser Printer with Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOMES & HOME OFFICES – Engineered for consistent, premium print quality, the Brother HL-L2405W Monochrome (Black & White) Laser Printer delivers sharp, crisp prints at an affordable price. Prints one-sided documents at speeds up to 30ppm(2)
  • COMPACT, CONNECTED PRINTER – Flexible connection options make this an ideal printer for home use and at-home offices. Securely connect to multiple devices with built-in dual-band wireless (2.4GHz/5GHz) or locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Manage your printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Enjoy seamless, reliable everyday printing with the 250-sheet paper tray(4) and a manual feed slot that enables printing on envelopes and specialty pape
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer
@media print {
  body {
    margin: 0;
    color: #000;
    background: #fff;
    font: 11pt/1.45 Georgia, serif;
  }

  main {
    max-width: none;
    width: auto;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }
}

The type size and font here are starting values, not universal requirements. Check that the content remains readable in the output your readers will use. If readers need to identify link destinations on paper, you can append the URL for external links:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
@media print {
  a[href^="http"]::after {
    content: " (" attr(href) ")";
  }
}

Use this selectively if long URLs would clutter the page; the selector matches links whose href begins with http.

Rank #3
Sale
Canon imageCLASS LBP6030w - Monochrome Single-Function Wireless Compact Wireless Laser Printer, 1 Year Limited Warranty, 19 PPM, White - Print Only
  • FAST PRINT SPEEDS: Print up to 19 pages per minute.
  • COMPACT DESIGN: Space-saving, compact design fits anywhere in your home, school or small office.
  • WIRELESS CONNECTIVITY: Print from almost anywhere in your workspace using your compatible mobile device.
  • PAPER CAPACITY: Up to 150 sheets.
  • SUSTAINABILITY: Uses less than 2 watts in Energy Saver mode.

Set page margins and orientation with @page

The @page rule sets preferences for printed page dimensions, orientation, and margins. For example:

@page {
  size: auto;
  margin: 16mm;
}

size: auto leaves the page size to the output setup; change it only when you have a reason to request a particular paper size or orientation. A printer may have non-printable areas, and browser or printer-dialog settings can override author preferences. For supported page properties and pseudo-classes, see MDN’s @page reference. MDN’s CSS paged media guide explains page areas and printable regions.

Rank #4
Brother HL-L2460DW Wireless Compact Monochrome Laser Printer with Duplex, Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOME OFFICES & SMALL TEAMS – Engineered for consistent, premium print quality, the Brother HL-L2460DW Monochrome (Black & White) Laser Printer produces documents that are clear, crisp, and easy to review and share, all at an affordable price
  • COMPACT, CONNECTED, EXCEPTIONALLY EFFICIENT– Connect with built-in dual-band wireless (2.4GHz/5GHz), Ethernet, or to a single computer via USB interface. Prints at speeds up to 36ppm(2), plus automatic duplex printing saves time and reduces paper waste
  • BROTHER MOBILE CONNECT APP – Manage your wireless printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Tackle high-volume black & white printing with the 250-sheet capacity paper tray.(4) The manual feed slot enables printing on envelopes and specialty paper
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Control page breaks without trapping content

Use fragmentation properties to influence where content starts, ends, or stays together across printed pages:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • break-before and break-after can encourage a break before or after an element.
  • break-inside: avoid can discourage a break within an element, such as a figure, card, or table row.

For example, avoid splitting compact elements when practical:

Best Value
HP LaserJet M110w Wireless Black & White Printer, Print, Fast speeds, Easy Setup, Mobile Printing, Best-for-Small Teams
  • FROM AMERICA'S MOST TRUSTED PRINTER BRAND – Perfect for small teams printing professional-quality black & white documents and reports. Perfect for 1-3 people
  • WORLD'S SMALLEST LASER IN ITS CLASS – Precision laser printing that fits anywhere
  • FAST PRINT SPEEDS – Up to 21 black-and-white pages per minute single-sided
  • WIRELESS WITH SELF-RESET – Helps you stay connected
  • PRINT FROM ANY DEVICE – Wireless printing from any mobile device, PC or tablet. Works with Microsoft, Mac, AirPrint, Android, Chromebook and more
@media print {
  h1,
  h2,
  h3,
  figure,
  table,
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

The legacy page-break-inside alias is included for older engines. Avoid applying “keep together” rules indiscriminately to long sections: an element taller than a page cannot fit intact. The W3C CSS Print Profile describes page-break-inside: avoid as a preference and notes that a printer may still split content that exceeds a page. CSS paged media also has fragmentation limits, including widows and orphans; consult the W3C CSS 2.2 paged media specification for those constraints.

Debug print preview when the layout changes

Print styles still participate in the normal CSS cascade. If an intended rule has no effect, make sure the print block is loaded and ordered correctly, then check specificity and computed styles in the browser’s developer tools while previewing the page for print.

Look for common screen-layout assumptions that cause print problems:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Fixed heights that clip text or images.
  • Overflow settings that cut off content.
  • Transformed containers that shift or scale content unexpectedly.
  • Fixed-position interface elements that cover printed material.
  • Backgrounds or colors that reduce contrast or consume ink.
  • Broad hide selectors that remove content as well as controls.

Test long headings, code blocks, tables, images, links, and sections that continue across several pages. CSS paged-media behavior and the final result can vary with the browser, printer driver, physical printer, and settings in the print dialog.

Validate the output readers will actually use

  1. Open the page’s print preview and inspect the whole document, not just the first page.
  2. Check that navigation and interactive controls are gone while the main content, headings, links, and meaningful images remain.
  3. Inspect page margins, text width, link treatment, and breaks around tables, figures, and other elements that should stay together.
  4. Test the actual PDF export or printer path your readers are likely to use, because preview and output can differ with browser, driver, device, and dialog settings.

The W3C CSS Print Profile (2013) sets out print-specific conformance requirements and implementation limits. The W3C’s CSS 2.2 media types specification defines print for paged material and print preview, and describes targeting it through @media or a stylesheet’s media attribute.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.