分割容器后面栏或页面 | break-after
break-after
break-after
CSS 属性定义了页面、列或区域分隔符在生成的框之后的行为方式。如果没有生成的框, 则忽略该属性。
/* Generic break values */
break-after: auto;
break-after: avoid;
/* Page break values */
break-after: avoid-page;
break-after: page;
break-after: always;
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
值以及包含元素的值。
要确定是否必须进行break操作,应用以下规则:
- 如果这三项值是
被迫中断值之一
(always
,left
,right
,page
,column
,或region
),它具有优先权。如果不止一个是这样一个中断,那么在流中出现最新的那个元素(即break-before
优先于break-after
,break-after
优先于break-inside
)。
- 如果任何三种有关值是
避免中断值
(avoid
,avoid-page
,avoid-region
,avoid-column
),在该点处不施加任何动作。
一旦应用了强制中断, 可以在需要时添加软断点, 但不能在相应的避免值中解析的元素边界上进行。
初始值 | auto |
---|---|
应用于 | block-level elements |
是否继承 | no |
媒体 | paged |
计算值 | as specified |
动画类型 | discrete |
规范顺序 | the unique non-ambiguous order defined by the formal grammar |
语法
break-after
属性被指定为下面列表中的一个关键字值。
取值
一般中断值
auto
允许(但不强制)在主体框之后插入任何中断(页面,列或区域)。
分页符值
avoid-page
在主体框后面避免任何分页符。
列中断值
avoid-column
在主体框之后避免任何列中断。
区域中断值
avoid-region
避免在主框之后出现任何区域中断。
形式语法
auto | avoid | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region
规范
Specification | Status | Comment |
---|---|---|
CSS Fragmentation Module Level 3The definition of 'break-after' in that specification. | Candidate Recommendation | Adds the recto and verso keywords. Changes the media type of this property from paged to visual. Defines the breaking algorithm with different kinds of breaks. |
CSS Regions Module Level 1The definition of 'break-after' in that specification. | Working Draft | Extends the property to handle region breaks. Adds the avoid-region and region keywords. |
CSS Multi-column Layout ModuleThe definition of 'break-after' in that specification. | Candidate Recommendation | Initial definition. Extends the CSS 2.1 page-break-after property to handle both page and column breaks. |
浏览器兼容性
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | No support1 | (Yes)2 | No support | 10 | 11.10 - 12.1 | No support1 |
column, avoid-column | No support1 | No support | No support | 10 | 11.10 - 12.1 | No support1 |
recto, verso | No support | No support | No support | No support | No support | No support |
region, avoid-region | No support1 | No support | No support | No support | No support | No support1 |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | No support1 | (Yes)2 | No support | ? | ? | No support1 |
column, avoid-column | No support1 | No support | No support | ? | ? | No support1 |
recto, verso | No support | No support | No support | No support | No support | No support |
region, avoid-region | No support1 | No support | No support | No support | No support | No support1 |