aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/line-break/index.html
blob: 93aa342f4060411d73fca65c167db4150e53938b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
title: line-break
slug: Web/CSS/line-break
tags:
  - CSS
  - CSS Text
  - CSS 属性
  - Reference
translation_of: Web/CSS/line-break
---
<div>{{CSSRef}}</div>

<p>设置 CSS 属性 <strong><code>line-break</code> </strong>可以用来处理如何断开(break lines)带有标点符号的中文、日文或韩文(CJK)文本的行。</p>

<pre class="brush:css no-line-numbers">/* Keyword values */
line-break: auto;
line-break: loose;
line-break: normal;
line-break: strict;
line-break: anywhere;

/* Global values */
line-break: inherit;
line-break: initial;
line-break: unset;
</pre>

<div>{{cssinfo}}</div>

<h2 id="语法">语法</h2>

<h3 id="值"></h3>

<dl>
 <dt><code>auto</code></dt>
 <dd>使用默认的断行规则分解文本。</dd>
 <dt><code>loose</code></dt>
 <dd>使用尽可能松散(least restrictive)的断行规则分解文本。一般用于短行的情况,如报纸。</dd>
 <dt><code>normal</code></dt>
 <dd>使用最一般(common)的断行规则分解文本。</dd>
 <dt><code>strict</code></dt>
 <dd>使用最严格(stringent)的断行原则分解文本。</dd>
 <dt><code>anywhere</code></dt>
 <dd>
 <p>在每个印刷字符单元(typographic character unit)的周围,都有一个自动换行(soft wrap)的机会,包括任何标点符号(punctuation character)或是保留的空白字符(preserved white spaces),或是单词之间。但忽略任何用于阻止换行的字符,即使是来自 GL、WJ 或 ZWJ 字符集的字符,或是由 word-break 属性强制的字符。不同的换行机会拥有相同的优先级。也不应用断字符(hyphenation,可能是 "-")。</p>
<p>英文原文:There is a soft wrap opportunity around every typographic character unit, including around any punctuation character or preserved white spaces, or in the middle of words, disregarding any prohibition against line breaks, even those introduced by characters with the GL, WJ, or ZWJ character class or mandated by the word-break property. The different wrapping opportunities must not be prioritized. Hyphenation is not applied.</p>
 </dd>
</dl>

<h3 id="正式语法">正式语法</h3>

{{csssyntax}}

<h2 id="规范">规范</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Text', '#line-break-property', 'line-break')}}</td>
   <td>{{Spec2('CSS3 Text')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<div>{{Compat("css.properties.line-break")}}</div>