You are here: Reference > CSS > properties > page-break-before

page-break-before property

Browser support:
Specifies whether a page break occurs before the object when printing.
This property doesn't take any effect on absolutely positioned elements. The page break is only visible in a print preview or when printing. If you need other page breaking rules, use the page-break-after and page-break-inside properties.
JavaScript page for this property: pageBreakBefore. You can find other example(s) there.

Possible values:

 One of the following values: 
always
Always force a page break before the element.
auto
Default. Insert a page break before the element when necessary.
avoid
Avoid a page break before the current element.
empty string
Page break is not inserted before the element.
inherit
Takes the value of this property from the computed style of the parent element.
left
Force one or two page breaks before the current element, so that the next page is considered a left page.
right
Force one or two page breaks before the current element, so that the next page is considered a right page.
Default: auto.

Example HTML code 1:

This example illustrates the use of the page-break-before property:
<head>
    <style>
        .example {
            page-break-before: always;
        }
    </style>
</head>
<body>
    Please open the print preview to see the result!
    <p class="example">page break before this element</p>
    text content
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content