page-break-inside Attribute | pageBreakInside Property
Gets or sets a string indicating whether a page break is allowed to occur inside the object.
Syntax
CSS { page-break-inside : sBreak } Scripting [ sBreak = ] object.style.pageBreakInside [ = sBreak ]
Possible Values
sBreak String that specifies or receives one of the following values.
- auto
- Default. Neither force nor forbid a page break inside the object.
avoid- Forbid a page break inside the object, if possible.
empty string- Behaves the same as
auto.inherit- Inherit the value of the same property for the object's parent.
The property is read/write for all objects except the following, for which it is read-only: currentStyle. The property has a default value of auto. The Cascading Style Sheets (CSS) attribute is not inherited.
Remarks
This property applies when the document is printed.
Normally, Windows Internet Explorer attempts to avoid page breaks inside tables, blocks with borders, and positioned or floated elements. The pageBreakInside attribute extends this behavior to other elements. A value of
avoidinstructs the browser to start the element on the following page if there is not enough room for it on the current page.Page-break behavior is inherited from parent objects. A potential page-break location is also influenced by the page-break-after attribute of the preceding object, and/or the page-break-before attribute of the following object.
This property requires Internet Explorer to be in IE8 Standards mode rendering.
Example
The following style rule causes Internet Explorer to avoid breaking paragraphs across pages.
<meta http-equiv="X-UA-Compatible" content="IE=8" /> <style type="text/css"> @media print { p { page-break-inside: avoid; } } </style>
Standards Information
This property is defined in Cascading Style Sheets (CSS), Level 2 Revision 1 (CSS2.1).
Applies To
BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CSSStyleDeclaration, currentStyle, DD, DIR, DIV, DL, DT, FIELDSET, FORM, hn, ISINDEX, LI, LISTING, MARQUEE, MENU, OL, P, PRE, runtimeStyle, style, TABLE, TBODY, TFOOT, TH, THEAD, TR, UL, XMP, CSSCurrentStyleDeclaration Constructor, CSSRuleStyleDeclaration Constructor, CSSStyleDeclaration Constructor
See Also
CSS How-to - Optimize Pages for Printing Using CSS