The pageBreakBefore property sets or gets the page-break behavior before an element for printing or print preview.
The pageBreakBefore property has no effect on absolutely positioned elements.
The page break is only visible in a print preview or when printing.
For example
document.getElementById("footer").style.pageBreakBefore = "always";
Property Values
Value | Description |
---|---|
auto | Insert a page break before the element if necessary. default |
always | insert a page break before the element |
avoid | Avoid a page break before the element |
"" (empty string) | Page break is not inserted before the element |
left | Insert one or two page breaks before the element, so the next page is considered a left page |
right | Insert one or two page breaks before the element, so the next page is considered a right page |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
The pageBreakBefore property returns a String representing the page-break behavior before an element when printing.