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),那么这个属性的值就具有优先权。如果其中一个以上是这样的断点,则使用流中最新出现的元素的值。因此,break-before值优先于break-after值,而后者又优先于break-inside值。
  2. 如果三个相关值中的任何一个是避免中断值, 相关值包括 avoid, avoid-page, avoid-region, avoid-column, 则在该点上不应用此类中断。

一旦应用了强制中断,如果需要,可以添加软中断,但不能在元素边界上添加相应的avoid值。

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

Syntax

Values

auto
允许(既不禁止也不强制)在主框中插入任何中断(页、列或区域)。
avoid-page
避免主框中任何页的中断点
avoid-column
避免主框中任何列的中断点
avoid-region
避免原则框内的任何区域中断。

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
Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Supported in Multi-column LayoutChrome Full support 50Edge Full support 12Firefox Full support 65IE Full support 10Opera Full support 37
Full support 37
No support 11.1 — 12.1
Safari Full support 10WebView Android Full support 50Chrome Android Full support 50Firefox Android Full support 65Opera Android Full support 37
Full support 37
No support 11.1 — 12.1
Safari iOS Full support 10Samsung Internet Android Full support 5.0
multicol_context: column and avoid-columnChrome Full support 50Edge Full support 12Firefox No support NoIE Full support 10Opera Full support 37Safari Full support 10WebView Android Full support 50Chrome Android Full support 50Firefox Android No support NoOpera Android Full support 37Safari iOS Full support 10Samsung Internet Android Full support 5.0
Supported in Paged MediaChrome Full support 50Edge Full support 12Firefox Full support 65IE Full support 10Opera Full support 37
Full support 37
No support 11.1 — 12.1
Safari Full support 10WebView Android Full support 50Chrome Android Full support 50Firefox Android Full support 65Opera Android Full support 37
Full support 37
No support 11.1 — 12.1
Safari iOS Full support 10Samsung Internet Android Full support 5.0
paged_context: page and avoid-pageChrome Full support 51Edge Full support 12Firefox No support NoIE No support NoOpera Full support 38
Full support 38
No support 11.1 — 12.1
Safari No support NoWebView Android Full support 51Chrome Android Full support 51Firefox Android No support NoOpera Android Full support 41
Full support 41
No support 11.1 — 12.1
Safari iOS No support NoSamsung Internet Android Full support 5.0
Supported in CSS Regions
Experimental
Chrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.