CSS

越线 | line-break

line-break

这是一种实验技术

由于该技术的规格不稳定,请查看各种浏览器的兼容性表格以供使用。另外请注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。

line-breakCSS属性用于指定当与标点符号工作时如何(或是否)换行。

/* 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;

Initial valueauto
Applies toall elements
Inheritedno
Mediavisual
Computed valueas specified
Animation typediscrete
Canonical orderthe unique non-ambiguous order defined by the formal grammar

句法

可能值

auto——使用默认换行符规则分隔文本。

形式语法

auto | loose | normal | strict

规范

SpecificationStatusComment
CSS Text Module Level 3The definition of 'line-break' in that specification.Working DraftInitial definition

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support1 -webkit 58 (unprefixed)(Yes)No support15.52(Yes) -webkit 45 (unprefixed)(Yes)

FeatureAndroid WebviewChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support(Yes) -webkit 58 (unprefixed)18 -webkit 58 (unprefixed)(Yes)No support1?(Yes) -webkit 45 (unprefixed)(Yes)