English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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" |
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
The following table describes the values of this attribute.
Value | Description |
---|---|
auto | If necessary, insert a page break after the element. This is the default value. |
always | Always force a page break after the element. |
avoid | Avoid page breaks after the element. |
left | Force a page break once or twice after the element, so that the next page will become the left page. |
right | Force a page break once or twice after the element, so that the next page will become the right page. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element uses its parent element page-break-Values of the after attribute. |
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.
|
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.
Please refer to the following tutorials:CSS Media Types.
Related Attributes:page-break-before,page-break-inside.