Style pageBreakBefore attribute

Definition and Usage

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

Note:pageBreakBefore The 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-before attribute

Example

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

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

Try it yourself

Syntax

Return the pageBreakBefore attribute:

object.style.pageBreakBefore

Set the pageBreakBefore attribute:

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

Property Value

Value Description
auto Default. Insert a pagination symbol before the element if necessary.
always Always insert a pagination symbol before the element.
avoid Avoid inserting a pagination symbol before the element.
"" (empty string) No pagination symbol is inserted before the element.
left Sufficient pagination symbols before the element, until an empty left page.
right Sufficient pagination symbols before the element, until an empty right page.
initial Sets this property to its default value. See also initial.
inherit Inherits this property from its parent element. See also inherit.

Technical Details

Default value: auto
Return value: A string that represents the pagination behavior of an element before printing.
CSS Version: CSS2

Browser Support

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