CSS page-break-before Property

Always insert a page break before each <h1> element (when printing):

@media print {
h1 {page-break-before: always;}
}

Definition and Usage

The page-break-before property sets whether a page break should occur BEFORE a specified element.

Note: You cannot use this property on an empty <div> or on absolutely positioned elements.

Default value: auto
Inherited: no
Animatable: no. Read about animatable
Version: CSS2
JavaScript syntax: object.style.pageBreakBefore=”always”
CSS Syntax
page-break-before: auto|always|avoid|left|right|initial|inherit;
Property Values
Value Description
auto Default. Automatic page breaks
always Always insert a page break before the element
avoid  Avoid page break before the element (if possible)
left Insert page breaks before the element so that the next page is formatted as a left page
right Insert page breaks before the element so that the next page is formatted as a right page
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Post Author: Zahid Farid