line-break

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

CSS 属性 line-break 设置在处理标点符号和符号时如何断开中文,日文或韩文(CJK)文本的行。

/* Keyword values */
line-break: auto;
line-break: loose;
line-break: normal;
line-break: strict;

/* Global values */
line-break: inherit;
line-break: initial;
line-break: unset;
初始值auto
适用元素all elements
是否是继承属性
适用媒体visual
计算值as specified
Animation typediscrete
正规顺序the unique non-ambiguous order defined by the formal grammar

语法

auto
使用缺省的断行规则分解文本。
loose
使用最松散的断行规则分解文本。一般用于短行的情况,如报纸。
normal
使用最一般的断行规则分解文本。
strict
使用最严格的断行原则分解文本。

正式语法

auto | loose | normal | strict

规范

Specification Status Comment
CSS Text Module Level 3
line-break
Working Draft Initial definition

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
line-break
Experimental
Chrome Full support 58
Full support 58
Full support 1
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Edge Full support 14Firefox Full support 69IE Full support 5.5
Full support 5.5
Full support 8
Prefixed
Prefixed Implemented with the vendor prefix: -ms-
Opera Full support 45
Full support 45
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Safari Full support 3
Prefixed
Full support 3
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
No support 2 — 3
Prefixed
Prefixed Implemented with the vendor prefix: -khtml-
WebView Android Full support 58
Full support 58
Full support ≤37
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Chrome Android Full support 58
Full support 58
Full support 18
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Firefox Android No support NoOpera Android Full support 43
Full support 43
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Safari iOS Full support 1
Prefixed
Full support 1
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Samsung Internet Android Full support 7.0
Full support 7.0
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-

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.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.