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

Use the modern CSS Fragmentation properties in your print stylesheet: break-before: page (or break-after: page) to force a new PDF page, and break-inside: avoid-page to discourage a suitable block from splitting. These rules work only in a paged print context, so test the actual PDF produced by your browser or HTML-to-PDF engine.

@media print {
  .new-page { break-before: page; }
  .keep-together { break-inside: avoid-page; }
}

Choose the rule that matches the problem

Page overflow usually means one of two different things. You may need a deliberate boundary before a section, or you may need to keep a small block intact. Do not use an avoidance rule when you actually need a forced page.

Goal Use What it does
Start an element on a fresh page break-before: page Forces a page break before the element.
End an element and start the next page break-after: page Forces a page break after the element.
Keep a short block together where possible break-inside: avoid-page Discourages a break inside the block; it cannot shrink content or fit an oversized block onto one page.

The modern properties are preferred for new CSS. Older declarations such as page-break-before: always, page-break-after: always, and page-break-inside: avoid remain as legacy aliases for compatibility.

Force a page before a section

Put the break on the block that should begin on the next page. Use a semantic class rather than selecting every heading, because a heading may legitimately follow the preceding content on the same page.

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)
<article>
  <section class="chapter">
    <h1>Introduction</h1>
    <p>Content for the first chapter.</p>
  </section>

  <section class="chapter new-page">
    <h1>Methods</h1>
    <p>This section starts on a new PDF page.</p>
  </section>
</article>
@media print {
  .new-page {
    break-before: page;
  }
}

The target must generate a box in normal print flow. A rule on an element with no generated box has nothing to fragment, so it is ignored. Check that the class is present in the printed DOM and that another selector is not overriding it.

Force a page after the preceding block

You can express the same boundary from the other side. This is useful when a component always ends a page, regardless of which section follows it.

@media print {
  .chapter-end {
    break-after: page;
  }
}

Use one boundary rule while debugging. Applying break-after: page to one element and break-before: page to the adjacent element is redundant and can produce an unexpected blank page.

Keep a block from splitting

break-inside: avoid-page is a request to place an intact block on one page when the renderer can do so. It is appropriate for a summary card, a short figure-and-caption group, a signature area, or a compact table row group.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
@media print {
  .summary-card,
  .figure-caption-group {
    break-inside: avoid-page;
  }
}

Choose a block that can actually fit in the printable area. If its height exceeds the page, the renderer cannot honor the request without hiding or resizing content. Applying avoidance to an entire long article can also create poor pagination: the engine may move a large block to the next page and leave a large blank region. Split the content into smaller meaningful groups or allow the long content to break.

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

Understand how competing break rules resolve

Fragmentation considers the previous box’s break-after, the next box’s break-before, and the containing element’s break-inside. A forced break takes precedence over an avoidance value. When two forced values meet at one boundary, the value later in the flow wins; in practice, a following element’s break-before takes precedence over the preceding element’s break-after.

For example, if a card has break-after: page but the next section has break-before: avoid-page, the forced break still applies. If both neighboring elements force a break, remove one while diagnosing the layout so you can see which boundary is intended.

Put rules in print media and set page geometry separately

Keep pagination declarations in a print stylesheet so they do not affect the continuous screen layout.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
@media print {
  .new-page { break-before: page; }
  .keep-together { break-inside: avoid-page; }
}

@page {
  size: A4;
  margin: 18mm 16mm;
}

@page controls page setup such as paper size and margins. Break properties control where content fragments within that available area. A margin change can move a block to the following page even when the break rules are unchanged. Browser print dialogs may also apply user-selected paper, scale, headers, footers, or margins, so record those settings when reproducing a problem.

A complete print stylesheet pattern

This example establishes a new page for each chapter, keeps small callouts together, and permits a long article to flow naturally.

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.
<main class="report">
  <section class="chapter">
    <h1>Executive summary</h1>
    <div class="summary-card keep-together">
      <p>A short summary that should remain intact.</p>
    </div>
  </section>

  <section class="chapter new-page">
    <h1>Detailed findings</h1>
    <p>This section starts on a fresh page.</p>
    <div class="figure-caption-group keep-together">
      <figure>
        <img src="chart.png" alt="Results chart">
        <figcaption>Results by month.</figcaption>
      </figure>
    </div>
  </section>
</main>
@media print {
  .new-page {
    break-before: page;
  }

  .keep-together {
    break-inside: avoid-page;
  }
}

@page {
  size: Letter;
  margin: 0.7in;
}

Do not put the forced break on a heading that is removed or repositioned by print-only styles. Put it on the section or other block that owns the content you want to move.

Why a break may appear to be ignored

Print CSS is not active

Confirm that the declaration is inside @media print and that the print stylesheet is loaded. In browser developer tools, enable print emulation and inspect the element’s computed styles.

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

The selector targets the wrong element

Inspect the printed DOM, not only the screen markup. Frameworks may render a different wrapper for print, and a class on a non-generated element has no fragmentation effect.

A cascade override wins

Check later rules, higher-specificity selectors, inline styles, and print utility classes. Look at the computed value for break-before, break-after, and break-inside on the boxes immediately before and after the intended boundary.

The content does not fit the usable page

Inspect @page size and margins, browser print margins, scale, and any fixed-height container. A block that is taller than the printable region cannot be kept intact. Remove an unnecessary fixed height, reduce the grouping, or allow the content to fragment.

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

Adjacent forced breaks create a blank page

Search for both sides of the boundary. Keep either break-after: page on the preceding block or break-before: page on the following block while testing.

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

The layout model complicates fragmentation

Flex, grid, tables, positioned elements, transforms, and nested overflow containers can change how content fragments. Reduce the document to a small reproduction, then add the layout pieces back one at a time. A rule that works for ordinary block flow is not proof that every complex layout will paginate identically.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Tables, flexbox, grid, and oversized elements

Tables

Keep avoidance on a small row group or caption rather than an entire multi-page table. Let the table split when it is longer than one page, and verify the header-row behavior in the renderer that creates the final PDF.

Flex and grid

Test the actual engine and version. Chromium’s LayoutNG implementation added flex and grid fragmentation in Chrome 103, table fragmentation in Chrome 106, and block fragmentation for printing in Chrome 108. These milestones describe Chromium implementation history, not a guarantee that every browser or server-side PDF pipeline will paginate the same way.

Fixed, transformed, or overflowed content

Large fixed-height boxes, overflow: hidden, transforms, and absolutely positioned content can hide or move material outside normal fragmentation. Remove those constraints in a reduced test case before adding more break declarations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
HP LaserJet M209dw Wireless Printer, Print, Fast speeds, Easy Setup, Mobile Printing, Best-for-Small Teams, Instant Ink Eligible
  • HP LaserJet M209dw Wireless Printer, Print, Fast speeds, Easy setup, Mobile printing, Best-for-small teams, Instant Ink eligible
  • Perfect for small teams printing black & white documents and reports, plus auto two-sided printing. Perfect for 1-5 people
  • FASTEST TWO-SIDED PRINTING IN ITS CLASS – Up to 30 black-and-white pages per minute single-sided, u up to 19 black-and-white images per minute two-sided printing
  • DUAL-BAND WI-FI WITH SELF-RESET – Automatically detects and resolves connectivity issues
  • STRONG SECURITY – Built-in security features help protect your printer from potential attacks

Validate the PDF from the real renderer

  1. Open the document with the same browser or HTML-to-PDF service used in production.
  2. Enable print preview or print-media emulation and verify the computed break property.
  3. Check paper size, margins, scale, and browser-added headers or footers.
  4. Save the PDF and inspect the file, not only the preview.
  5. Repeat the check after changing the renderer version or layout model; pagination is implementation-dependent.

CSS fragmentation applies inside a paged fragmentation context. Ordinary screen rendering is a continuous canvas, so a page break can appear to do nothing until print media or PDF generation is active.

Use legacy aliases only when compatibility requires them

For older templates, this declaration remains recognizable:

@media print {
  .new-page {
    page-break-before: always;
  }

  .keep-together {
    page-break-inside: avoid;
  }
}

The legacy page-break-* properties are aliases. page-break-before: always and page-break-after: always map to the page-specific behavior of the modern properties. For new code, use break-before, break-after, and break-inside so the intent is explicit and the same syntax can support other fragmentation contexts.

Or skip the browser setup

If you need a clean capture of a URL while diagnosing a print layout, ScreenshotNeo provides a website screenshot API and MCP server. A single request can return a PNG, JPEG, WebP, or PDF; use the output format and PDF settings documented at the ScreenshotNeo documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/print-page -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com/print-page"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com/print-page' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  • Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers identify the page verdict and billing result.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
  • The Free plan includes 1,000 screenshots each month with no card. Paid plans start at $5 for 3,000 shots; Growth is $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000, and Business $249 for 1,000,000. Yearly billing gives two months free, and every feature is available on every plan.

Create a free ScreenshotNeo account to get the 1,000 monthly screenshots without a card.

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.