W3docs

CSS page-break-after Property

The CSS -page-break-after property defines page break after a specified element See the values of this property.

The page-break-after property defines a page break after an element.

This property does not apply to absolutely positioned elements.

Warning

The page-break-after property is replaced by the break-after property.

Browsers should treat the page-break-after property as an alias of break-after. This assures that sites using the page-break-after property still work as designed.

Initial Valueauto
Applies toBlock-level elements.
InheritedNo.
AnimatableNo.
VersionCSS2
DOM Syntaxobject.style.pageBreakAfter = "avoid";

Syntax

CSS page-break-after syntax

page-break-after: auto | avoid | always | left | right | initial | inherit;

You can insert the following piece of code with page-break-after in your CSS code:

CSS page-break-after code example

@media print {
  footer {
    page-break-after: left;
  }
}

Values

ValueDescription
autoAllows inserting any page break after the element.
avoidAvoids inserting any page break after the element.
alwaysForces inserting any page break after the element.
leftInsert a page break after the element so that the next page is formatted as a left page.
rightInsert a page break after the element so that the next page is formatted as a right page.
initialSets this property to its default value.
inheritInherits this property from its parent element.

Note: For modern web development, use the break-after property instead, as page-break-after is deprecated.

Practice

Practice

What does the 'page-break-after' property do in CSS?