CSS page-break-inside Property
The CSS page-break-inside property controls whether a page break is allowed within an element when a document is printed.
It is a legacy property used to keep related content, such as images, tables, and information panels, together on a printed page. Modern CSS uses break-inside for page, column, and other fragmentation controls, while page-break-inside remains available for compatibility.
page-break-inside Syntax
The page-break-inside property accepts two values: auto and avoid. CSS-wide keywords are also supported.
Basic Syntax
selector {
page-break-inside: avoid;
}
This requests that the browser avoid splitting the selected element across printed pages.
Available Values
.section {
page-break-inside: auto;
}
.section {
page-break-inside: avoid;
}
The auto value permits normal pagination. The avoid value discourages page breaks within the element.
CSS-Wide Keywords
.section {
page-break-inside: initial;
}
.section {
page-break-inside: inherit;
}
.section {
page-break-inside: unset;
}
.section {
page-break-inside: revert;
}
.section {
page-break-inside: revert-layer;
}
CSS-wide keywords must be used individually and cannot be combined with other values in the same declaration.
Property Values
| Value | Description |
|---|---|
auto |
Allows the browser to insert page breaks within the element when needed. |
avoid |
Requests that page breaks not occur within the element. |
initial |
Resets the property to its initial value of auto. |
inherit |
Uses the computed value from the parent element. |
unset |
Resets the property to auto because it is not inherited. |
revert |
Reverts the property according to CSS cascade origin rules. |
revert-layer |
Reverts the property according to CSS cascade layer rules. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | auto |
| Inherited | No |
| Applies to | Block-level elements in normal flow within paged media |
| Computed value | As specified |
| Animation type | Discrete |
| Percentages | Not applicable |
| Primary use | Printed and paginated documents |
| Modern replacement | break-inside |
| Status | Legacy compatibility property |
Valid Values
.report-card {
page-break-inside: avoid;
}
.report-section {
page-break-inside: auto;
}
.print-table {
page-break-inside: avoid;
}
figure {
page-break-inside: avoid;
}
Invalid Values
.section {
page-break-inside: always;
}
.section {
page-break-inside: page;
}
.section {
page-break-inside: 20px;
}
.section {
page-break-inside: avoid-page;
}
The legacy property does not accept always, page, lengths, or the modern avoid-page keyword. Use break-inside: avoid-page when writing modern CSS.
How It Works
When a browser prepares a document for printing, it divides the content into page-sized areas. The page-break-inside property influences whether an element may be divided between those pages.
Allowing Page Breaks
.article {
page-break-inside: auto;
}
The browser may split the article across pages when necessary. This is the default behavior.
Avoiding Page Breaks
.article-summary {
page-break-inside: avoid;
}
The browser attempts to keep the summary together on one printed page.
Moving Content to the Next Page
If an element with page-break-inside: avoid does not fit in the remaining space, the browser may move the entire element to the next page.
Page Breaks Within Normal Flow
The property primarily affects block-level content in normal document flow. Its behavior can differ for flex items, grid items, and other layout contexts.
Important Limitation
The avoid value is a request, not an absolute guarantee. Content larger than a page may still need to be divided.
Avoiding Page Breaks Within Elements
Preventing unnecessary splits can improve the readability of printed reports, invoices, forms, and other documents.
Keeping a Content Card Together
@media print {
.content-card {
page-break-inside: avoid;
}
}
The browser attempts to keep the entire card on one page.
Keeping a Heading and Paragraph Together
<section class="summary-block">
<h2>Project Summary</h2>
<p>This paragraph contains the project summary.</p>
</section>
@media print {
.summary-block {
page-break-inside: avoid;
}
}
Grouping the heading and paragraph in a section allows the browser to keep them together when possible.
Keeping List Items Together
@media print {
li {
page-break-inside: avoid;
}
}
This can help prevent individual list items from being divided across pages.
Keeping Form Sections Together
@media print {
fieldset {
page-break-inside: avoid;
}
}
Related form controls can remain grouped when a form is printed, provided the fieldset fits within the available page area.
When to Use Avoidance
Apply break avoidance to reasonably sized content groups. Avoid applying it indiscriminately to entire long documents because large sections may be impossible to keep together.
Tables and Figures
Tables, images, captions, and related content often benefit from page-break controls.
Keeping a Figure Together
<figure class="print-figure">
<img src="chart.png" alt="Quarterly sales chart">
<figcaption>Quarterly Sales Overview</figcaption>
</figure>
@media print {
.print-figure {
page-break-inside: avoid;
}
}
The browser attempts to keep the image and its caption on the same page.
Keeping Table Rows Together
@media print {
tr {
page-break-inside: avoid;
}
}
This requests that individual table rows not be split across pages. Actual behavior depends on the browser's table fragmentation support.
Keeping a Small Table Together
@media print {
.summary-table {
page-break-inside: avoid;
}
}
A small summary table may be moved to the next page rather than divided.
Long Tables
Large tables often need to span multiple pages. Avoid applying page-break-inside: avoid to an entire table that is taller than the printable page area.
Repeating Table Headers
@media print {
thead {
display: table-header-group;
}
}
Browsers may repeat table headers on subsequent printed pages when a table spans multiple pages.
Practical Consideration
Test tables and figures in Print Preview because page-break behavior can vary across browsers and PDF generators.
Handling Content Larger Than a Page
An element cannot always fit on one printed page. The browser must balance break-avoidance requests with the need to display all content.
Oversized Content
@media print {
.long-article {
page-break-inside: avoid;
}
}
If the article is taller than the printable page area, the browser may ignore the avoidance request and split the article.
Grouping Smaller Sections
<article>
<section class="article-part">
<h2>Overview</h2>
<p>Overview content.</p>
</section>
<section class="article-part">
<h2>Details</h2>
<p>Detailed content.</p>
</section>
</article>
@media print {
.article-part {
page-break-inside: avoid;
}
}
Applying avoidance to smaller sections gives the browser more flexibility than applying it to the entire article.
Allowing Normal Pagination
@media print {
.long-content {
page-break-inside: auto;
}
}
Use auto when an element is expected to span multiple pages.
Controlling Related Breaks
@media print {
h2 {
page-break-after: avoid;
}
.content-section {
page-break-inside: avoid;
}
}
Combining break controls can help keep headings with their content while allowing the overall document to paginate naturally.
Important Consideration
Content should remain readable even when the browser cannot honor every break-avoidance request.
Modern Alternative: break-inside
The page-break-inside property is deprecated in favor of break-inside, which provides more comprehensive fragmentation controls.
Legacy Syntax
.report-card {
page-break-inside: avoid;
}
Modern Syntax
.report-card {
break-inside: avoid-page;
}
The modern avoid-page value specifically requests that page breaks be avoided within the element.
Value Comparison
| page-break-inside | break-inside |
|---|---|
auto |
auto |
avoid |
avoid or avoid-page |
The modern avoid value requests avoidance across applicable fragmentation contexts. The avoid-page value specifically targets page breaks.
Compatibility Pattern
@media print {
.report-card {
page-break-inside: avoid;
break-inside: avoid-page;
}
}
The legacy declaration supports older print engines, while the modern declaration provides an explicit page-break avoidance rule.
Modern Fragmentation Values
.item {
break-inside: auto;
}
.item {
break-inside: avoid;
}
.item {
break-inside: avoid-page;
}
.item {
break-inside: avoid-column;
}
The break-inside property also supports column-break avoidance, which is not available through page-break-inside.
Important Distinction
The legacy property is specifically concerned with page breaks. Use break-inside for new stylesheets that require broader fragmentation control.
Using page-break-inside With Print Media
Page-break rules are generally placed inside an @media print block so they apply specifically to printed output.
Print-Specific Break Avoidance
@media print {
.summary-card {
page-break-inside: avoid;
}
}
This requests that the summary card remain on one printed page without changing its normal screen layout.
Combining With @page
@page {
size: A4;
margin: 20mm;
}
@media print {
.summary-card {
page-break-inside: avoid;
}
}
The @page rule requests page dimensions and margins, while page-break-inside influences how content is divided between those pages.
Screen and Print Styles
.summary-card {
padding: 20px;
border: 1px solid #cbd5e1;
background-color: #f8fafc;
}
@media print {
.summary-card {
padding: 10px;
background: transparent;
page-break-inside: avoid;
}
}
The card retains its screen styling while using print-specific spacing and break avoidance.
Print Preview
Use the browser's Print Preview feature to inspect how content is divided before printing or saving the document as a PDF.
Printer and Browser Settings
Paper size, margins, scaling, and browser print behavior can affect whether an element fits on a page. Test using the intended print settings.
page-break-inside Example
The following example demonstrates how to request that individual report cards remain together when printed.
HTML Example
<div class="print-report">
<section class="report-card">
<h2>Project Overview</h2>
<p>This card contains the project introduction.</p>
<p>Additional information belongs to the same card.</p>
</section>
<section class="report-card">
<h2>Project Details</h2>
<p>This card contains the project details.</p>
<p>Related information should remain together.</p>
</section>
<section class="report-card">
<h2>Project Summary</h2>
<p>This card contains the final summary.</p>
</section>
</div>
CSS Example
.print-report {
display: grid;
gap: 15px;
}
.report-card {
padding: 20px;
border: 2px solid #2563eb;
background-color: #dbeafe;
}
.report-card h2 {
margin: 0 0 10px;
}
.report-card p {
margin: 0 0 8px;
}
.report-card p:last-child {
margin-bottom: 0;
}
@media print {
.print-report {
display: block;
}
.report-card {
margin-bottom: 15px;
page-break-inside: avoid;
break-inside: avoid-page;
}
}
Screen Preview
The following preview shows the report cards as they appear on screen. The break-avoidance rules are applied when printing, not when viewing the page normally.
Project Overview
This card contains the project introduction.
Additional information belongs to the same card.
Project Details
This card contains the project details.
Related information should remain together.
Project Summary
This card contains the final summary.
Expected Print Behavior
| Situation | Requested Behavior |
|---|---|
| A card fits in the remaining page space | The card remains on the current page. |
| A card does not fit in the remaining space | The browser may move the entire card to the next page. |
| A card is taller than a full page | The browser may split the card despite the avoidance request. |
The property helps preserve individual content groups without requiring every card to begin on a separate page.
Practical Print Layout
@media print {
.report-card,
figure,
.summary-table {
page-break-inside: avoid;
break-inside: avoid-page;
}
h2,
h3 {
page-break-after: avoid;
break-after: avoid-page;
}
}
This combines break avoidance within content groups with rules that discourage separating headings from following content.
Accessibility Considerations
Keeping related content together can improve the readability and organization of printed documents.
Keep Related Content Together
Use break avoidance for figures, captions, short tables, and information panels that should be read as a group.
Preserve Logical Reading Order
Page-break controls do not change the HTML source order. Maintain meaningful document structure and heading hierarchy.
Avoid Excessive Whitespace
Applying break avoidance to large sections can produce unnecessary blank areas. Use it selectively to balance readability and page usage.
Maintain Readable Print Layouts
Test printed documents for clipped text, separated captions, broken tables, and content that becomes difficult to follow across pages.
Consider PDF Accessibility
Page-break controls do not automatically create accessible PDF structure. Accessibility depends on the source document and the capabilities of the PDF generation process.
Important Consideration
Break avoidance can improve printed presentation, but semantic HTML, logical reading order, and readable typography remain essential.
Common Mistakes
Using always
.section {
page-break-inside: always;
}
The always keyword is invalid. Use auto or avoid.
Using the Modern avoid-page Value
.section {
page-break-inside: avoid-page;
}
The avoid-page keyword belongs to the modern break-inside property. Use page-break-inside: avoid for the legacy property.
Using Length or Percentage Values
.section {
page-break-inside: 20px;
}
The property accepts page-break keywords, not spacing values.
Expecting Screen Layout Changes
Page-break controls affect paged media. They do not create visible page boundaries in ordinary scrolling webpages.
Applying avoid to Entire Documents
Long documents cannot always fit on one page. Apply avoidance to smaller content groups rather than an entire report or article.
Assuming avoid Is Guaranteed
The browser may override break avoidance when content cannot fit within the available page area.
Ignoring Table Fragmentation
Browsers may handle page breaks within tables and table rows differently. Always test complex tables in Print Preview.
Confusing Break Inside With Break Before or After
page-break-inside controls breaks within an element. page-break-before and page-break-after control breaks at its boundaries.
Ignoring Modern CSS
The legacy property remains useful for compatibility, but new print stylesheets should also consider break-inside.
Important Considerations
Keep the following points in mind when using page-break-inside:
- It controls page breaks within elements in paged media.
- It is a legacy property retained for compatibility.
- The modern replacement is
break-inside. - Its initial value is
auto. - The property is not inherited.
- The
autovalue allows normal pagination. - The
avoidvalue requests that an element remain on one page. - The legacy property accepts only
autoandavoid, apart from CSS-wide keywords. - The
alwayskeyword is invalid. - The
avoid-pagekeyword belongs to the modern property. - Lengths and percentages are not accepted.
- Break avoidance is not guaranteed when content cannot fit.
- Oversized elements may still be divided across pages.
- Small content groups are better candidates for break avoidance than entire documents.
- The property can help keep figures and captions together.
- It can help prevent individual list items from being split.
- Table fragmentation behavior varies across browsers.
- Long tables may need to span multiple pages.
- Legacy and modern declarations can be combined for compatibility.
- Page-break rules are commonly placed inside
@media print. - The
@pageat-rule controls page dimensions and margins. - The
page-break-beforeandpage-break-afterproperties control breaks at element boundaries. - Excessive break avoidance can create large blank areas on printed pages.
- Page-break controls do not change the semantic structure of HTML.
- Print Preview should be used to verify the final pagination.
Browser Support
The CSS page-break-inside property is Widely available in modern browsers, including Chrome, Edge, Firefox, and Safari. It has been supported for many years as part of CSS paged-media styling.
The property is deprecated in favor of break-inside. Although legacy support remains broad, browsers may differ in their handling of break avoidance, especially for tables, flexbox, grid layouts, and oversized content.
For current compatibility information, visit Can I Use? and search for page-break-inside.
Specifications
The legacy page-break-inside property originates from CSS Level 2 and is maintained through compatibility requirements in modern CSS fragmentation specifications.
CSS Fragmentation Module Level 3
The specification describes how legacy page-break properties map to modern fragmentation properties.
For additional documentation and examples, consult MDN Web Docs.
