MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

break-inside

这篇翻译不完整。请帮忙从英语翻译这篇文章

break-inside CSS 属性描述了在多列布局页面下的内容盒子如何中断,如果多列布局没有内容盒子,这个属性会被忽略。

break-inside: auto;
break-inside: avoid;
break-inside: avoid-page;
break-inside: avoid-column;
break-inside: avoid-region;

在每一个元素的边界,都可能生成一个中断点,这些中断点由三个属性来定义。break-after 属性定义之前元素的中断点,break-before 定义了之后元素的中断点, break-inside 定义了当前元素的中断点。

如果需要定义一个中断点,必须遵循以下原则:

  1. 如果这三个中断属性的值有一个是强制中断值(这些强制中断值包括了 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 break-before value has precedence over the break-after value, which itself has precedence over the break-inside value).
  2. If any of the three concerned values is an avoid break value, that is 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.

初始值auto
适用元素block-level elements
是否是继承属性
适用媒体paged
计算值as specified
Animation typediscrete
正规顺序the unique non-ambiguous order defined by the formal grammar

Syntax

Values

auto
Allows, meaning neither forbid nor force, any break (either page, column or region) to be be inserted within the principle box.
avoid-page
Avoid any page break within the principle box.
avoid-column
Avoid any column break within the principle box.
avoid-region
Avoid any region break within the principle box.

Formal syntax

auto | avoid | avoid-page | avoid-column | avoid-region

Specifications

Specification Status Comment
CSS Fragmentation Module Level 3
break-inside
Candidate Recommendation  
CSS Regions Module Level 1
break-inside
Working Draft Extends the property to handle region breaks.
CSS Multi-column Layout Module
break-inside
Candidate Recommendation Initial definition

Browser compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 未实现 [*] (Yes)[1] 未实现 10 11.10 未实现 [*]
column, avoid-column 未实现 [*] 未实现 未实现 10 11.10 未实现 [*]
recto, verso 未实现 未实现 未实现 未实现 未实现 未实现
region, avoid-region 未实现 [*] 未实现 未实现 未实现 未实现 未实现 [*]
Feature Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 未实现 [*] (Yes)[1] 未实现 ? ? 未实现 [*]
column, avoid-column 未实现 [*] 未实现 未实现 ? ? 未实现 [*]
recto, verso 未实现 未实现 未实现 未实现 未实现 未实现
region, avoid-region 未实现 [*] 未实现 未实现 未实现 未实现 未实现[*]

[*] WebKit and Blink browsers don't support this property, but some have the non-standard -webkit-column-break-before and -webkit-region-break-before with similar parameters as page-break-before.

[1] Edge also supports the non-standard -webkit-column-break-inside variant.

文档标签和贡献者

 此页面的贡献者: SheltonDong
 最后编辑者: SheltonDong,