English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Complete list of CSS attributes

CSS page-break-Usage and examples of 'after' property

Insert a page break after the element when printing a document. page-break-The 'after' property applies to generating boxes forBlock-levelElement. It will not apply to an empty <p> and will not generate a blank box.

The following table provides usage instructions and version history for this property, as well as the syntax for using this property in JavaScript scripts.

Default value:auto
Applies to:Block-level element
Inheritance:None
Animatable:No.Please see Animation Attributes.
Version:CSS 2,3
JavaScript Syntax:object.style.pageBreakAfter="avoid"

page-break-Syntax of using after

The syntax of this attribute is as follows:

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

The following examples demonstrate how to use page-break-after attribute.

  @media print {
   p.footnotes {
    page-break-after: always;      
   }
  }
Test to see‹/›

The style rule in the above example sets the pagination behavior to always paginate and move to a new page after the footnote.

Note:page-break-The after attribute is only applicable to the root element ortable-rowelements in the normal flow ofBlock-levelElement

Attribute Value

The following table describes the values of this attribute.

ValueDescription
autoIf necessary, insert a page break after the element. This is the default value.
alwaysAlways force a page break after the element.
avoidAvoid page breaks after the element.
leftForce a page break once or twice after the element, so that the next page will become the left page.
rightForce a page break once or twice after the element, so that the next page will become the right page.
initialSet this attribute to its default value.
inheritIf specified, the associated element uses its parent element page-break-Values of the after attribute.

Browser Compatibility

page-break-Browser Compatibility of the after attribute, the numbers in the following table represent the minimum version number of the browser that supports this attribute; all mainstream browsers partially support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 4+

  • Apple Safari 1.2+

  • Opera 7+

Warning: Internet Explorer 8And earlier versions do not support these values left and right; any value is interpreted as always. Firefox, Chrome, and Safari do not support the values avoid, left, or right.

Further Reading

Please refer to the following tutorials:CSS Media Types.

Related Attributes:page-break-before,page-break-inside.