越线 | line-break (Text) - CSS 中文开发手册
这是一种实验技术
由于该技术的规格不稳定,请查看各种浏览器的兼容性表格以供使用。另外请注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。
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 value | auto |
|---|---|
| Applies to | all elements |
| Inherited | no |
| Media | visual |
| Computed value | as specified |
| Animation type | discrete |
| Canonical order | 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 3The definition of 'line-break' in that specification. | Working Draft | Initial definition |
浏览器兼容性
| Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
| Basic support | 1 -webkit 58 (unprefixed) | (Yes) | No support1 | 5.52 | (Yes) -webkit 45 (unprefixed) | (Yes) |
| Feature | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|---|
| Basic support | (Yes) -webkit 58 (unprefixed) | 18 -webkit 58 (unprefixed) | (Yes) | No support1 | ? | (Yes) -webkit 45 (unprefixed) | (Yes) |