Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS page-break-before property

CSS page-break-before property

Example

in

Always insert a page break before the element:

@media

print

{

h1

{

page-break-before:

always

;

}

}


Property definition and usage

page-break-before adds a page break before the specified element.

Note: You cannot use this property on absolutely positioned elements.

**Note:** Use page-break properties as sparingly as possible, and avoid using them in tables, floated elements, and block elements with borders.

Default value: auto
Inherited: no
Version: CSS2
JavaScript syntax: object.style.pageBreakBefore="always"

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the page-break-before property.

Note: Any version of Internet Explorer (including IE8) supports the values "left", "right", and "inherit".

Note: Firefox, Chrome, and Safari do not support the values "avoid", "left", and "right".


Attribute values

Value Description
auto Default. A page break is inserted before the element if necessary.
always Insert a page break before the element.
avoid Avoid inserting a page break before the element.
left Insert enough page breaks before the element to reach a blank left-hand page.
right Insert enough page breaks before the element to reach a blank right-hand page.
inherit Specifies that the page-break-before property should be inherited from the parent element.