Style pageBreakInside attribute

Definition and Usage

pageBreakInside Attribute sets or returns the pagination behavior within an element (used for printing or print preview).

Note:pageBreakInside The attribute has no effect on absolutely positioned elements. Page breaks are only visible in print preview or when printing.

Tip:Avoid using the page break property within tables, floating elements, and bordered block elements.

See also:

CSS Reference Manual:page-break-inside attribute

Example

Avoid page breaks within the <p> element with id="footer":

document.getElementById("footer").style.pageBreakInside = "avoid";

Try it yourself

Syntax

Return pageBreakInside attribute:

object.style.pageBreakInside

Set pageBreakInside attribute:

object.style.pageBreakInside = "auto|avoid|initial|inherit"

Attribute value

Value Description
auto Default. Insert page breaks within elements if necessary.
avoid Avoid inserting page breaks within elements.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical details

Default value: auto
Return value: String that indicates the pagination behavior of the element's content when printed.
CSS version: CSS2

Webbläsarstöd

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Stöd Stöd Stöd Stöd Stöd