style.pageBreakAfter (Property)

The placement of a page break after the styled element.


CSS level - 2
DOM level - 2
JavaScript - 1.5
JScript - 3.0
Internet Explorer - 4.0
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.pageBreakAfter
CSS syntax:page-break-after: aSwitch
Argument list:aSwitchA page break control value

This is part of the support for printing pages. A browser doesn't need to mark the breaks between pages because its pages are of unlimited length and width when the scrollbars are present. You need this for printouts, though, because the paper has a finite size.

The following keywords can be applied to this property:

These attributes are part of the CSS level 2 specification, which is not yet fully supported in most browsers.

The auto setting allows the browser to use its best opinion on whether to place a page break after the element.

The left and right keywords provide a swinging format capability based on whether the page is an odd or even page (by implication odd number pages are rightwards). This allows page breaks to be placed depending on whether element flows onto a right, or leftwards facing page.

The always value requires that a page break happens after this element on every occasion regardless of whether the page is odd or even.

The CSS level 2 standard allows for the property to contain the avoid value. This is not yet supported in all browsers and simply inhibits page breaks after the element.

The above all applies equally to the pageBreakBefore property apart from noting that the page break is placed prior to the object rather than after it.

The pageBreakInside property only honors the auto, avoid and inherit keywords.


See also:style.orphans, style.size, style.widows