Attribut break-after CSS
- page before box-sizing
- Page suivante break-before
Définition et utilisation
L'attribut break-after détermine si une pagination (page-break), une rupture de colonne (column-break) ou une rupture de région (region-break) doit se produire après l'élément spécifié.
L'attribut break-after étend l'attribut page-break-after de CSS2.
En utilisant break-after, vous pouvez informer le navigateur de rompre la page, la colonne ou la région après l'élément auquel l'attribut break-after est appliqué, ou éviter de rompre l'élément et de le diviser sur deux pages.
Example
Always insert a page break before the <footer> element.
@media print { footer { break-after: always; } }
CSS syntax
break-after: auto|all|always|avoid|avoid-column|avoid-page|avoid-region|column|left|page|recto|region|right|verso|initial|inherit;
Property value
Value | Description |
---|---|
auto | Default. Automatically paginate, columnize, and partition after the element. |
all | Always insert a page break immediately after the main box. |
always | Always insert a page break after the element. |
avoid | Avoid page, column, or region breaks after the element. |
avoid-column | Avoid columning after the element. |
avoid-page | Avoid paging after the element. |
avoid-region | Avoid partitioning after the element. |
column | Always insert a column break after the element. |
left | Insert one or two page breaks after the element to format the next page as a left page. |
page | Always insert a page break after the element. |
recto | Insert one or two page breaks after the main box to format the next page as a recto page. |
region | Always insert a separator after the element. |
right | Insert one or two page breaks after the element to format the next page as a right page. |
verso | Insert one or two page breaks after the main box to format the next page as a verso page. |
initial | Set this property to its default value. See initial. |
inherit | Inherit this property from its parent element. See inherit. |
Technical details
Default value: | auto |
---|---|
Inheritance: | No |
Animation creation: | Not supported. See:Animation-related properties. |
Version: | CSS3 |
JavaScript syntax: | object.style.breakAfter="always" |
More examples
Example
Always insert a page break after the element with id "toc":
@media print { #toc { break-after: always; } }
Example
Always insert a separator after the <ul> element within a certain region:
.region ul { break-after: region; } }
Browser support
The numbers in the table indicate the first browser version that fully supports this property.
Chrome | IE / Edge | Firefox | Safari | Opera |
---|---|---|---|---|
50.0 | 10.0 | 65.0 | 10.0 | 37.0 |
- page before box-sizing
- Page suivante break-before