Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style pageBreakInside Property

Style pageBreakInside Property

Style Object Reference The Style object


Definition and Usage

The pageBreakInside property sets or returns the page-breaking behavior inside an element (for printing or print preview).

**Note:** The pageBreakInside property does not affect absolutely positioned elements.

Syntax

Set the pageBreakInside property:

Object.style.pageBreakInside="auto|avoid|inherit"

Return the pageBreakInside property:

Object.style.pageBreakInside

Value Description
auto Default. A page break is inserted inside the element if necessary.
avoid Avoid inserting a page break inside the element.
inherit The value of the pageBreakInside property is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the pageBreakInside property.

**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".

**Note:** Firefox, Chrome, and Safari do not support the "avoid" property value.


Tips and Notes

**Tip:** Page-break properties should be avoided inside tables, floating elements, and bordered block elements.


Example

Example

In the id="footer"

element, avoid a page break:

Runoob Tutorial(runoob.com)

This is a heading

This is a paragraph

Try it »


Style Object Reference The Style object