← Blog
13 Aug 2026page break beforeCSS print stylingbreak-beforepaged mediaPDF generation

Page Break Before Guide with Practical Examples

Learn how to use the page break before CSS property to control print layouts with practical code examples and browser support tips.

Page Break Before Guide with Practical Examples

You’re staring at a print preview that looked fine yesterday and now starts a totals block halfway down a page. The HTML is clean, the layout works on screen, and the browser still refuses to put the next section where you want it. That’s the moment page break before stops feeling like an old CSS footnote and starts feeling like the one rule that can save the shipment.

Table of Contents

Why Developers Still Reach for page-break-before in 2026

A developer gets handed a print stylesheet, opens the PDF export, and sees a chapter heading orphaned at the bottom of the page. The fix sounds simple enough, move the heading to the top of the next page, but the browser won’t cooperate. That’s exactly where page-break-before still earns its keep, because it tells the rendering engine whether a page break should happen before an element.

MDN describes it as a legacy CSS pagination property, and that legacy label matters less than the job it does in production. The property was standardized early for browser-era print styling, and it stuck around for backward compatibility, which is why you still see it in documentation and old codebases today. Modern paged-media behavior has largely shifted toward the break-before family, but print stylesheets, PDFs, and document-rendering pipelines still need deterministic boundaries for reports, invoices, and forms. MDN’s reference for page-break-before is the clearest reminder that this is about layout control, not nostalgia.

An infographic titled why developers still reach for page-break-before in 2026 showing reasons for using the property.

The feature also shows up outside the browser. Microsoft Word includes a Page break before paragraph option, and Microsoft Access and Reporting Services expose page-break controls for content blocks, groups, and tables. Oracle’s reporting docs even spell out that you can’t insert a page break before the first column or above the first row in a grid, which shows how pagination engines enforce layout rules rather than letting content split anywhere they want. Microsoft’s reporting and document-layout guidance makes the point plainly, page boundaries are a core part of enterprise document production.

Platform Where it appears Why it matters
Microsoft Word Paragraph pagination settings Gives editors a direct “Page break before” control for document flow
Microsoft Access Report and layout controls Supports grouped report output with predictable page starts
Reporting Services Report design page-break options Helps report authors separate blocks and tables cleanly
Oracle reporting Grid and column pagination rules Enforces hard layout constraints in paged output

Practical rule: use page break before when the reader needs a section to start at the top of a fresh page, not when you just want extra spacing.

Core Syntax and Values You Can Use Today

The basic declaration is short, and that’s part of why the property survives in old stylesheets.

.chapter-title {
  page-break-before: always;
}

That rule says the browser should start the element on a new page. If you’re maintaining a codebase that already uses legacy print rules, this is the syntax you’ll recognize in the wild. If you’re building something new, it’s still useful as a fallback when you need older engines to behave.

The legacy values in plain language

  • auto means let the engine decide. It’s the default, so you only use it when you want to clear a previous rule.
  • always means force a break before the element. Think of it as a hard stop.
  • avoid means ask nicely for no break before the element. Browsers may ignore it if the layout needs a split.
  • left means the next page should be a left page in duplex output.
  • right means the next page should be a right page in duplex output.

A useful mental model is simple. auto is the traffic light, always is the red barrier, avoid is a polite request, and left and right are print-room instructions for book-style pagination.

Legacy value What it does
auto Lets the engine decide
always Forces a break before the element
avoid Asks the engine not to break there
left Forces the next output to land on a left page
right Forces the next output to land on a right page

The modern counterpart is break-before, which expands the vocabulary beyond page-only pagination. If your team already uses utility-driven CSS or modern print logic, it’s worth planning around that newer property. The migration details matter, but the short version is easy, keep the legacy property in place where older engines still matter, and prefer the modern one in fresh code. For teams using design tokens or shared styles, the pattern can fit cleanly alongside other CSS variables and system rules, as shown in this guide to CSS variables.

Use the legacy name when compatibility matters, and the modern name when you control the whole pipeline.

How Rendering Engines Decide Where to Break

The browser doesn’t treat page-break-before like a blunt instrument. At the vertical margin between block boxes, the engine applies page-break conflict rules, and if any meeting box specifies always, left, or right, a break must occur there. The user agent also resets the relevant margin contribution at that break point, which is why the result can look different from what you expected if you were only thinking in terms of normal document flow. The CSS 2.1 pagination rules describe that conflict behavior directly.

That detail explains a lot of “why didn’t my break land there?” bugs. You might set a rule on the second element, but the engine still evaluates the relationship between adjacent boxes, their margins, and the paged-media constraints before it commits to the split. The property can override ordinary flow, but it doesn’t cancel every other layout rule in the document.

A four-step infographic illustrating how rendering engines decide where to place a page break in documents.

A concrete two-element example

<div class="first">Summary block</div>
<div class="second">Details block</div>
.first {
  margin-bottom: 24px;
}

.second {
  page-break-before: always;
}

The second block forces the break, but the first block’s margin still participates in the layout before the engine finalizes the page boundary. That’s why a forced break can still leave a gap that feels too large or oddly placed. The break isn’t ignoring the earlier box, it’s resolving the page boundary after evaluating the surrounding margin behavior.

The confusion to watch for

A lot of developers assume page break before means “split exactly here, no matter what.” It doesn’t. It means “request a break before this element, then let the pagination engine reconcile that request with the rest of the page model.” If you keep that in mind, debugging becomes much less mysterious. For browser-specific behavior and differences across print pipelines, browser compatibility guidance helps you decide when to trust the browser and when to test the generated output directly.

Practical Examples for Print and PDF Workflows

The cleanest way to learn pagination is to use it where it matters. Teams hit the same three scenarios, chapter headings in print styles, invoice totals that must begin on a fresh page, and duplex reports where the next section should land on a specific side.

Chapter headings in a print stylesheet

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

This is the classic case. A report, handbook, or proposal reads better when each chapter starts at the top of a page, especially if the content is later exported to PDF.

Invoice totals that start on a new page

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

Use this when the totals block needs visual separation from line items. If the totals section is conditional, make sure your template only renders the element when there’s something to print, or you’ll create a blank page. In Word-based reporting workflows, this same pattern shows up as a page-break-before paragraph setting, which is why teams moving documents between browser and office tools keep running into the same pagination instincts.

Duplex-friendly report sections

@media print {
  .appendix {
    page-break-before: left;
  }
}

left and right are only useful when your output respects facing pages. If your printer or PDF workflow ignores duplex layout, the rule may not behave the way a book designer expects, so test it in the exact rendering path you ship.

The other piece teams mix up is @page. That rule handles page size, margins, and other page-level settings, while page-break-before controls where the content flow starts a new page. They work together, but they don’t do the same job. If your output pipeline starts in a browser and ends in a PDF, keep that separation clear before you start tweaking paper size, margins, or section breaks.

If you’re using a print preview tool inside a browser-based workflow, verify the break there first. Screenshot-based checks are useful later, but the browser preview shows whether the CSS rule is being honored before a PDF tool adds its own interpretation. The same logic applies if you’re converting structured text into another format, even something as different as turning plain text into EPUB, because pagination still depends on the target renderer.

Migrating From page-break-before to break-before

The modern property is break-before, and the migration is mostly about syntax clarity and layout scope. The legacy names still work in many engines, but the newer property speaks the language of page, column, and region fragmentation more directly.

Legacy value Modern break-before value Notes
auto auto Same intent, let the engine decide
always page Modern value names the page break explicitly
avoid avoid Same intent, though actual behavior still depends on layout rules
left left Preserves duplex-aware pagination
right right Preserves duplex-aware pagination

The biggest practical difference is the newer vocabulary. break-before can express breaks in page, column, and region contexts, which matters if your layout uses multi-column flow or other fragmentation models. That makes it a better fit for modern CSS architecture, especially when you’re not just thinking about print, but about documents that may move between screen, paper, and PDF output.

A defensive pattern is common in production stylesheets.

.section-start {
  page-break-before: always;
  break-before: page;
}

That keeps legacy engines covered while giving modern ones the explicit rule they expect. The order matters less than the fact that both declarations exist, because you’re writing for a mixed ecosystem, not a single browser version.

Keep the legacy property when you know older document pipelines are still in play, and prefer break-before for new work. If a team owns both the browser output and the PDF export path, it’s usually cleaner to standardize on the modern value and leave the legacy declaration as a fallback rather than as the primary API.

Using Pagination Inside Vue, Tailwind, and DOM Studio Workflows

Pagination gets easier once you treat it like any other UI behavior, not a special print-only exception. In Vue, that usually means exposing a prop or class on a component wrapper so the parent decides whether a section should break before printing. A simple approach is to map a printBreak prop to a class on the root element, then let the stylesheet handle the actual pagination rule.

<template>
  <section :class="{ 'page-break': printBreak }">
    <slot />
  </section>
</template>
@media print {
  .page-break {
    break-before: page;
    page-break-before: always;
  }
}

Tailwind fits this pattern too. A utility class like print:break-before-page keeps the intent visible in the component markup, which is useful when teams want print behavior to sit next to layout decisions instead of being hidden in a separate stylesheet. For teams standardizing Tailwind v4 conventions, this Tailwind CSS 4 guide is a useful companion when you’re wiring responsive and print variants together.

Shadow DOM adds one more layer. If a web component encapsulates its styles, the pagination rule has to live where the renderer can see it, not just in a distant global stylesheet. That’s why headless primitives and thin wrappers are helpful, they let you preserve semantic structure while still exposing a print-specific prop or utility class where the app can reach it.

The same logic applies to document-heavy workflows built from components. If a page is assembled from reusable blocks, the break rule should travel with the block, not with a one-off template override. That keeps your print behavior consistent when the same content appears in a dashboard, a generated report, or a PDF export path.

Common Pitfalls and How to Debug Them

Most pagination bugs look like CSS failures, but the root cause is usually more specific. The browser is either honoring a rule you didn’t notice, ignoring one you thought was active, or applying a different layout algorithm than the one you tested in.

An infographic titled Common Pitfalls and How to Debug Them listing four web development printing issues.

The quick checklist

  • Margin collapse gap: A forced break can leave an unexpected blank space if the preceding block’s margins collapse. Add padding or adjust the surrounding spacing so the page boundary behaves predictably.
  • Browser ignoring the rule: The print stylesheet may not be linked, or the media query may be wrong. Check that the rule lives under the right print context before blaming the property itself.
  • Inconsistent PDF output: Generators like Puppeteer, wkhtmltopdf, and browser-based print engines can interpret breaks differently. Test the exact output path and try break-before when page-break-before is too unreliable.
  • Flex and grid surprises: Section breaks inside flex or grid containers often fail because the layout algorithm changes how the break opportunity is handled. Move the break to a block-level wrapper or change the container structure.

Debug from the renderer backward, not from the markup forward.

The fastest fix is usually to isolate one page, one break rule, and one output path. If that minimal version still fails, the bug is in the rendering context, not the content. If it works there, the problem is probably an interaction with margins, container layout, or a stronger rule elsewhere in the cascade.

Best Practices and a Verification Checklist

Use break-before for new code, keep page-break-before as a fallback where older engines still matter, and reserve always for places where the page split really must happen. Test in browser print preview before you trust a PDF generator, because the preview shows the CSS decision before the export tool adds its own layer. Pair the pagination rule with semantic HTML so the document still reads cleanly when it’s parsed for accessibility or transformed by another tool.

A short verification pass catches most surprises:

  1. Open print preview first.
    Confirm the break appears where you expect before exporting to PDF.

  2. Check the rendering path you ship.
    Browser preview, headless Chromium, and office-style export tools can behave differently.

  3. Keep the markup semantic.
    A heading should be a heading, not a styled div pretending to be one.

  4. Use forced breaks sparingly.
    The more you force, the more you fight the flow of the document.

If you’re working in a component system, keep pagination behavior close to the component contract so the next developer can understand it without hunting through a global print file. That’s the difference between a layout rule people trust and one they delete during the next refactor.


DOM Studio gives teams a way to build components that stay predictable when the interface leaves the screen and enters print or PDF workflows. If your Vue app needs accessible, reusable primitives that can carry pagination rules without turning into a one-off print hack, take a look at DOM Studio.