CSS page-break-before eigenschap
- 上一页 page-break-after
- Volgende pagina page-break-inside
Definition and usage
The page-break-before property sets the page-breaking behavior before the element.
Although pagination symbols can be forced to be placed with always, it cannot be guaranteed to avoid the insertion of pagination symbols, creators can at most require the user agent to try to avoid inserting pagination as much as possible.
Applied to:Non-floated block-level elements with position value 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:pageBreakBefore attribute
Example
Set pagination behavior to always occur 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 pagination symbol before the element if necessary. |
always | Insert a pagination symbol before the element. |
avoid | Avoid inserting a pagination symbol before the element. |
left | There is enough pagination symbol before the element, up to the left page of a blank page. |
right | There is enough pagination symbol before the element, up to the right page of a blank 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 |
- 上一页 page-break-after
- Volgende pagina page-break-inside