A propriedade CSS page-break-before
- the previous page page-break-after
- Próxima página page-break-inside
Definition and usage
The page-break-before property sets the page-breaking behavior before the element.
Although the 'always' can be used to force the placement of a page break, it cannot be guaranteed to avoid the insertion of a page break. Creators can at most request that the user agent try to avoid inserting a page break as much as possible.
Applied 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 block elements with borders.
See also:
HTML DOM Reference Manual:pageBreakBefore attribute
Example
Set the pagination behavior to always be performed after the table element:
<html> <head> <style> @media print { table {page-break-before:always;} } </style> </head> <body> .... </body> </html>
CSS syntax
page-break-before: auto|always|avoid|left|right|initial|inherit;
Attribute value
Value | Description |
---|---|
auto | Default value. Insert a page break before the element if necessary. |
always | Insert a page break before the element. |
avoid | Avoid inserting a page break before the element. |
left | There are enough page breaks before the element, up to a blank left page. |
right | There are enough page breaks before the element, up to a blank right page. |
inherit | Specifies that the page-break-before property should be inherited from the parent element. |
Technical details
Default value: | auto |
---|---|
Inheritance: | no |
Version: | CSS2 |
JavaScript syntax: | object.style.pageBreakBefore="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 |
- the previous page page-break-after
- Próxima página page-break-inside