Style pageBreakBefore attribute

Definition and Usage

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

Note:pageBreakBefore The attribute has no effect on elements with absolute positioning. 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 pageBreakBefore attribute:

object.style.pageBreakBefore

Set pageBreakBefore attribute:

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

Attribute 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 There are enough pagination symbols before the element, up to a blank left page.
right There are enough pagination symbols before the element, up to a blank right page.
initial Set this property to its default value. See initial.
inherit Inherit 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 before printing.
CSS version: CSS2

Webbläsarstöd

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Stöd Stöd Stöd Stöd Stöd