--- title: break-after slug: Web/CSS/break-after tags: - CSS - CSS 属性 - 参考 translation_of: Web/CSS/break-after ---
break-after
CSS 属性描述在生成的盒子之后的页面,列或区域中断行为(换句话说,如何以及是否中断)。如果没有生成的盒子,则该属性将被忽略。
/* Generic break values */ break-after: auto; break-after: avoid; break-after: always; break-after: all; /* Page break values */ break-after: avoid-page; break-after: page; break-after: left; break-after: right; break-after: recto; break-after: verso; /* Column break values */ break-after: avoid-column; break-after: column; /* Region break values */ break-after: avoid-region; break-after: region; /* Global values */ break-after: inherit; break-after: initial; break-after: unset;
每个潜在的断点(亦即每个元素的边界)都受到三个属性的影响:上一个元素的 break-after
值、下一个元素的 break-before
值以及当前元素自身的 break-inside
值。
以下规则被用于判断中断是否必要:
always
、 left
、 right
、 page
、 column
和 region
。If several of the concerned values is such a break, the one of the element that appears the latest in the flow is taken (that is the {{cssxref("break-before")}} value has precedence over the break-after
value, which itself has precedence over the {{cssxref("break-inside")}} value).avoid
, avoid-page
, avoid-region
, avoid-column
, no such break will be applied at that point.Once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding avoid
value.
{{cssinfo}}
The break-after
property is specified as one of the keyword values from the list below.
auto
avoid
always
{{experimental_inline}}all
{{experimental_inline}}avoid-page
page
left
right
recto
{{experimental_inline}}verso
{{experimental_inline}}avoid-column
column
avoid-region
{{experimental_inline}}region
{{experimental_inline}}For compatibility reasons, the legacy {{cssxref("page-break-after")}} property should be treated by browsers as an alias of break-after
. This ensures that sites using page-break-after
continue to work as designed. A subset of values should be aliased as follows:
page-break-after | break-after |
---|---|
auto |
auto |
left |
left |
right |
right |
avoid |
avoid |
always |
page |
The always
value of page-break-*
was implemented by browsers as a page break, and not as a column break. Therefore the aliasing is to page
, rather than the always
value in the Level 4 spec.
规范 | 状态 | 备注 |
---|---|---|
{{SpecName('CSS3 Fragmentation', '#break-between', 'break-after')}} | {{Spec2('CSS3 Fragmentation')}} | Adds the recto and verso keywords. Changes the media type of this property from paged to {{xref_cssvisual}}. Defines the breaking algorithm with different kinds of breaks. |
{{SpecName('CSS3 Regions', '#region-flow-break', 'break-after')}} | {{Spec2('CSS3 Regions')}} | Extends the property to handle region breaks. Adds the avoid-region and region keywords. |
{{SpecName('CSS3 Multicol', '#break-before-break-after-break-inside', 'break-after')}} | {{Spec2('CSS3 Multicol')}} | Initial definition. Extends the CSS 2.1 {{cssxref("page-break-after")}} property to handle both page and column breaks. |
{{Compat("css.properties.break-after.multicol_context")}}
{{Compat("css.properties.break-after.paged_context")}}