CSS page-break-beforeProperty
Example
Always insert a page break before the <h1> element:
@media print {
h1 {page-break-before: always;}
}
Attribute definition and usage description
The page-break-before property adds a page break before the specified element.
Note:You cannot use this property on absolutely positioned elements.
Note:Use pagination properties as sparingly as possible, and avoid using pagination properties in tables, floating elements, and block elements with borders.
| Default value: | auto |
|---|---|
| Inherited: | no |
| version: | CSS2 |
| JavaScript Syntax: | object.style.pageBreakBefore="always" |
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the page-break-before property.
Note:Any version of Internet Explorer (including IE8) supports the property values "left", "right", and "inherit".
Note:Firefox, Chrome, and Safari do not support the property values "avoid", "left", and "right".
Property value
| Value | Description |
|---|---|
| auto | Default value. Inserts a page break before the element if necessary. |
| always | Insert a page break before the element. |
| avoid | Avoid inserting a page break before the element. |
| left | Enough page breaks before the element until a blank left page is reached. |
| right | Enough page breaks before the element until a blank right page is reached. |
| inherit | Specifies that the setting of the page-break-before property should be inherited from the parent element. |