CSS page-break-before Property
CSS page-break-before
property adjusts page breaks before the current element.
Usages
The following table outline the usages and version history of this property.
Default value: | auto |
Applies to: | Block-level elements |
Inherited: | No |
Version: | CSS2 |
JavaScript Syntax: | object.style.pageBreakBefore = "avoid" |
Syntax
Here is a syntax for the CSS page-break-before
property
page-break-before: auto | always | avoid | left | right | initial | inherit;
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
auto | Default. Automatic page-break |
always | page-break insert before the element |
avoid | If possible avoid page-break before the element |
left | page-break insert before the element so that next page is formatted as a left page |
right | page-break insert before the element so that next page is formatted as a right page |
initial | Sets default value of this property |
inherit | Inherits this property from its parent element |
Examples
The example below shows to sets page-break-before property.
@media print {
section {
page-break-before: always;
}
}
Browser Compatibility
- Google Chrome 1+
- Mozilla Firefox 1+
- Internet Explorer 4+
- Opera 7+
- Safari 1.2+
Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.