Javascript DOM CSS Style pageBreakAfter Property

Introduction

The pageBreakAfter property sets or gets the page-break behavior after an element for printing or print preview.

The pageBreakAfter 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.pageBreakAfter = "always";

Property Values

Value Description
auto Insert a page break after the element if necessary. default
alwaysinsert a page break after the element
avoid Avoid a page break after the element
"" (empty string) Page break is not inserted after the element
left Insert one or two page breaks after the element, so the next page is considered a left page
right Insert one or two page breaks after 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 pageBreakAfter property returns a String representing the page-break behavior after an element when printing.




PreviousNext

Related