Style pageBreakBefore Property
The Style object
Definition and Usage
The pageBreakBefore property sets or returns the page-breaking behavior before an element (for printing or print preview).
**Note:** The pageBreakBefore property does not affect absolutely positioned elements.
Syntax
Set the pageBreakBefore property:
Object.style.pageBreakBefore="auto|always|avoid|emptystring|left|right|inherit"
Return the pageBreakBefore property:
Object.style.pageBreakBefore
| Value | Description |
|---|---|
| auto | Default. A page break is inserted before the element if necessary. |
| always | Always insert a page break before the element. |
| avoid | Avoid inserting a page break before the element. |
| "" (empty string) | Do not insert a page break before the element. |
| left | Insert one or two page breaks before the element, up to a blank left page. |
| right | Insert one or two page breaks before the element, up to a blank right page. |
| inherit | The value of the pageBreakBefore property is inherited from the parent element. |
Browser support





All major browsers support the pageBreakBefore property.
**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".
Example
Example
Always after every id="footer"
Set a page break before the element:
This is a heading
This is a paragraph
Click the button above to see the change in printing or print preview.
Try it »
The Style object