Style pageBreakAfter attribute

Definition and Usage

The pageBreakAfter attribute sets or returns the pagination behavior after the element (used for printing or print preview).

Note:pageBreakAfter This attribute has no effect on absolutely positioned elements. Pagination symbols are only visible in print preview or when printing.

See also:

CSS Reference Manual:page-break-after attribute

Example

Always set a pagination symbol after each <p> element with id="footer":

document.getElementById("footer").style.pageBreakAfter = "always";

Try It Yourself

Syntax

Return pageBreakAfter attribute:

object.style.pageBreakAfter

Set pageBreakAfter attribute:

object.style.pageBreakAfter = "auto|always|avoid|emptystring|left|right|initial|inherit"

Attribute Value

Value Description
auto Insert a pagination symbol after the element if necessary. Default.
always Always insert a pagination symbol after the element.
avoid Avoid inserting a pagination symbol after the element.
"" (empty string) No pagination symbol is inserted after the element.
left A sufficient number of pagination symbols after the element, until a blank left page.
right A sufficient number of pagination symbols after the element, until a blank right page.
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: A string that represents the pagination behavior of the element when printed.
CSS Version: CSS2

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support