CSS page-break-after Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Print & Columns

What You’ll Learn

The page-break-after property controls page breaks after an element when a document is printed. It is especially useful for reports, invoices, books, and any printable layout where each chapter or section should start on a new page.

01

Print Breaks

Control printed pages.

02

Syntax

auto, always, avoid.

03

Chapters

Break after headings.

04

Left / Right

Facing-page layouts.

05

avoid

Keep content together.

06

@media print

Print-only rules.

Introduction

The page-break-after property in CSS is used to control the behavior of page breaks after a specified element when printing a document.

This property is particularly useful for creating printable documents where control over page breaks is necessary, such as reports, invoices, or other formatted documents.

Definition and Usage

The page-break-after property can be applied to block-level elements when you need the content that follows to start on a new printed page. For example, you can force each chapter heading to end its page so the next chapter begins cleanly.

Like other print properties, page-break-after usually has little or no visible effect on a normal scrolling screen layout. Test your rules in the browser’s print preview to see the real result.

💡
Beginner Tip

On normal screen layouts, page-break-after may have little visible effect. It shines in print preview where the browser paginates your document.

📝 Syntax

The syntax for the page-break-after property is straightforward. It can be applied to block-level elements, and it takes one of several keyword values.

syntax.css
element {
  page-break-after: value;
}

Basic Example

page-break-after.css
@media print {
  h1 {
    page-break-after: always;
  }
}

Syntax Rules

  • Apply page-break-after to block-level elements such as headings, sections, and divs.
  • The value is a keyword: auto, always, avoid, left, or right.
  • The property is not inherited — set it on the element where the break should occur.
  • Use inside @media print when you only want breaks when printing.
  • For new projects, consider the modern break-after property as a replacement.

🎯 Default Value

The default value of the page-break-after property is auto. This means the browser will automatically insert a page break after the element if necessary.

⚡ Quick Reference

QuestionAnswer
Initial valueauto
Applies toBlock-level elements
InheritedNo
AnimatableNo
Common usePrint page breaks after block elements

💎 Property Values

The page-break-after property accepts keyword values that control page-break behavior after an element when printing.

ValueExampleDescription
autopage-break-after: auto;Allows the browser to automatically insert a page break if needed.
alwayspage-break-after: always;Always insert a page break after the element.
avoidpage-break-after: avoid;Avoid inserting a page break after the element.
leftpage-break-after: left;Insert one or two page breaks so the next page is formatted as a left page.
rightpage-break-after: right;Insert one or two page breaks so the next page is formatted as a right page.
initialpage-break-after: initial;Sets the property to its default value (auto).
inheritpage-break-after: inherit;Inherits the value from the parent element.
auto always avoid left right

When Does page-break-after Matter?

page-break-after only affects paginated output. These are the most common use cases:

  • Reports and invoices — Start each major section on a new printed page with page-break-after: always.
  • Books and manuals — Break after chapter headings so each chapter begins cleanly.
  • Readable grouping — Use avoid to keep headings with the paragraphs that follow them.
  • Duplex printing — Use left and right when odd and even pages need specific facing-page layout.

On a normal scrolling web page, you may not see any effect — that is normal. Test in print preview to verify behavior.

👀 Live Preview

A visual guide to page-break-after: always. When printing, content after the break marker starts on a new page.

Page 1
Chapter 1 content flows here.
page-break-after: always
Page 2
Chapter 2 starts on a new page.

Examples Gallery

Start with the reference chapter example, try forced breaks, keep headings with their content, and explore left/right facing-page rules.

Example 1 — Chapter Headings in Print

In this example, we’ll ensure that a page break always occurs after a heading when printing the document.

page-break-after-example.html
<style>
  @media print {
    h1 {
      page-break-after: always;
    }
  }
</style>

<h1>Chapter 1</h1>
<p>This is the first chapter.</p>

<h1>Chapter 2</h1>
<p>This is the second chapter.</p>
Try It Yourself

How It Works

Each h1 ends its printed page because of page-break-after: always. The next chapter begins on a fresh page, which is a common pattern for books and reports.

Example 2 — Always Break After a Section

Force a page break after a block element so the following section starts on a new printed page.

page-break-always.html
<style>
  .section-end {
    page-break-after: always;
  }
</style>

<h1>Report Section A</h1>
<p>Content for the first section.</p>
<div class="section-end"></div>
<h1>Report Section B</h1>
<p>This section starts on a new page when printed.</p>
Try It Yourself

How It Works

The empty .section-end div acts as a break marker. Anything after it begins on the next printed page.

Example 3 — Avoid a Break After a Heading

Use page-break-after: avoid to keep a heading visually connected to the content that follows it.

avoid-break.html
<style>
  @media print {
    h2 {
      page-break-after: avoid;
    }
  }
</style>

<h2>Chapter Title</h2>
<p>The paragraph stays with the heading instead of breaking away.</p>
Try It Yourself

How It Works

avoid tells the browser not to insert a break right after the element if it can be prevented — useful for keeping headings with their first paragraph in print.

📄 Facing Pages

Use left and right when printed documents need specific odd- or even-page layout in duplex printing.

Example 4 — Left and Right Page Breaks

Control whether the next page should be a left or right page in paged media.

page-break-facing.css
@media print {
  .cover {
    page-break-after: right;
  }

  .appendix {
    page-break-after: left;
  }
}
Try It Yourself

How It Works

The browser may insert one or two page breaks to satisfy the left/right requirement. This is most useful for book-style layouts and double-sided printing.

page-break-after vs break-after

page-break-after is the legacy print property. The modern replacement is break-after, which also supports column and region breaks.

In legacy stylesheets, page-break-after: always is equivalent to break-after: page. When writing new CSS, prefer break-after for better long-term support.

legacy-vs-modern.css
/* Legacy */
h1 {
  page-break-after: always;
}

/* Modern equivalent */
h1 {
  break-after: page;
}

🧠 How page-break-after Works

1

Content is paginated for print

When you print or export to PDF, the browser splits the document into pages.

Print media
2

You set page-break-after on an element

Choose always, avoid, left, or right to control the break after that element.

CSS rule
3

The browser applies the break rule

Following content moves to the next printed page, or the break is suppressed when avoid is used.

Layout engine
=

Organized printed output

Chapters and sections start where you intend in the final printed document.

Browser Compatibility

The page-break-after property is widely supported in modern browsers. It works reliably in browsers such as Chrome, Firefox, Safari, Edge, and Opera. This property is primarily used for print styles, so testing should be done by previewing the print version of your document in these browsers.

Legacy · Print support

Reliable print page-break control

Chrome, Firefox, Safari, Edge, and Opera support page-break-after for printed output.

96% Modern browser support
Google Chrome 51+ · Desktop & Mobile
Full support
Mozilla Firefox 65+ · Desktop & Mobile
Full support
Apple Safari 10+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 38+ · Modern versions
Full support

Testing tip

Use the browser’s print preview to verify page-break-after rules. For new projects, consider migrating to break-after.

page-break-after property 96% supported

Bottom line: page-break-after remains widely supported for print. Always test in print preview, and prefer break-after in new stylesheets.

Conclusion

The page-break-after property is an essential tool for creating well-formatted, printable documents.

By controlling where page breaks occur after specific elements, you can ensure that your printed content appears organized and professional. Experiment with different values to achieve the desired layout for your print media.

💡 Best Practices

✅ Do

  • Use page-break-after: always for print chapters and report sections
  • Scope print breaks inside @media print
  • Use page-break-after: avoid on headings for readability
  • Test in print preview in every target browser
  • Migrate legacy rules to break-after when updating stylesheets

❌ Don’t

  • Expect visible breaks on normal single-column screen pages
  • Overuse forced page breaks — too many blank pages hurt readability
  • Use page-break-after in new projects when break-after is available
  • Apply break rules without testing the printed output
  • Forget that left and right only matter in duplex paged media

Key Takeaways

Knowledge Unlocked

Five things to remember about page-break-after

Use these points when controlling printed page breaks.

5
Core concepts
02

auto Default

Browser decides.

Default
🖨 03

always / avoid

Force or prevent.

Keywords
04

left / right

Facing pages.

Keywords
ba 05

break-after

Modern replacement.

Companion

❓ Frequently Asked Questions

The page-break-after property controls whether a page break happens after an element when printing. It is used to start new pages after chapters, sections, or other blocks in printable documents.
The default value is auto. The browser inserts a page break only when the layout needs one.
always forces a page break after the element when printing. avoid tries to prevent a break immediately after the element so related content stays together.
Use it in print stylesheets for reports, invoices, books, and any document where you need predictable page breaks after headings or sections.
page-break-after is the older legacy property for print. break-after is the modern replacement. Browsers still support page-break-after, but new projects should prefer break-after.

Practice in the Live Editor

Open the HTML editor, apply page-break-after, and test print page breaks in print preview.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful