CSS page-break-after property
- Previous page @page
- Next Page page-break-before
Definition and usage
Sets the page-breaking behavior after the element of the page-break-after property.
Although it is possible to force a page break with always, it cannot be guaranteed to avoid the insertion of page breaks; creators can at most request that the user agent try to avoid inserting page breaks.
Applies to:Non-floated block-level elements with position values of relative or static.
Note:Use pagination attributes as little as possible and avoid using pagination attributes in tables, floating elements, and bordered block elements.
See also:
HTML DOM Reference Manual:pageBreakAfter attribute
Example
Set the pagination behavior to always paginate after the table element:
<html> <head> <style> @media print { table {page-break-after:always;} } </style> </head> <body> .... </body> </html>
CSS syntax
page-break-after: auto|always|avoid|left|right|initial|inherit;
Attribute value
Value | Description |
---|---|
auto | Default. Insert a page break after the element if necessary. |
always | Insert a page break after the element. |
avoid | Avoid inserting a page break after the element. |
left | A sufficient number of page breaks after the element, until a blank left page. |
right | A sufficient number of page breaks after the element, until a blank right page. |
inherit | Specifies that the page-break-after property should inherit its settings from the parent element. |
Technical details
Default value: | auto |
---|---|
Inheritance: | no |
Version: | CSS2 |
JavaScript syntax: | object.style.pageBreakAfter="always" |
Browser support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | IE / Edge | Firefox | Safari | Opera |
---|---|---|---|---|
1.0 | 4.0 | 1.0 | 1.2 | 7.0 |
- Previous page @page
- Next Page page-break-before