-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathOverview.src.html
More file actions
690 lines (621 loc) · 22.2 KB
/
Overview.src.html
File metadata and controls
690 lines (621 loc) · 22.2 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
<h3 id="white-space-collapsing">
White Space Collapsing: the 'text-space-collapse' property</h3>
<p class="issue">This section is still under discussion and may change in future drafts.</p>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>text-space-collapse</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>collapse | discard | [ [preserve | preserve-breaks] && [ trim-inner || consume-before || consume-after ]</td>
</tr>
<tr>
<th>Initial:</th>
<td>collapse</td>
</tr>
<tr>
<th>Applies to:</th>
<td>all elements</td>
</tr>
<tr>
<th>Inherited:</th>
<td>yes</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>specified value</td>
</tr>
</tbody>
</table>
<p>This property declares whether and how
<a href="#white-space-processing">white space</a> inside the element is
collapsed. Values have the following meanings, which must be interpreted
according to the <a href="#white-space-rules">white space processing
rules</a>:</p>
<dl>
<dt><dfn title="white-space:collapse">''collapse''</dfn></dt>
<dd>This value directs user agents to collapse sequences of white space
into a single character (or <a href="#line-break-transform">in some
cases</a>, no character).</dd>
<dt><dfn title="white-space:preserve">''preserve''</dfn></dt>
<dd>This value prevents user agents from collapsing sequences
of white space. Line feeds are preserved as forced line breaks.</dd>
<dt><dfn title="white-space:preserve-breaks">''preserve-breaks''</dfn></dt>
<dd>This value collapses white space as for ''collapse'', but preserves
line feeds as forced line breaks.</dd>
<dt><dfn title="white-space:discard">''discard''</dfn></dt>
<dd>This value directs user agents to "discard" all white space in the
element.
<dt><dfn title="white-space:trim-inner">''trim-inner''</dfn></dt>
<dd>For block containers this value directs UAs to discard all whitespace
at the beginning of the element up to and including the last line feed
before the first non-white-space character in the element as well as
to discard all white space at the end of the element starting with the
first line feed after the last non-white-space character in the element.
For other elements this value directs UAs to discard all whitespace
at the beginning and end of the element.</dd>
<dt><dfn title="white-space:consume-before">''consume-before''</dfn></dt>
<dd>This value directs the UA to collapse all collapsible whitespace
immediately before the start of the element.
<dt><dfn title="white-space:consume-after">''consume-after''</dfn></dt>
<dd>This value directs the UA to collapse all collapsible whitespace
immediately after the end of the element.
</dl>
<div class="example">
<p>The following style rules implement MathML's white space processing:
<pre>
<!-- -->@namespace m "http://www.w3.org/1998/Math/MathML";
<!-- -->m|* {
<!-- --> text-space-collapse: discard;
<!-- -->}
<!-- -->m|mi, m|mn, m|mo, m|ms, m|mtext {
<!-- --> text-space-collapse: trim-inner;
<!-- -->}</pre>
</div>
<div class="example">
<p>The following style rules render DT elements as a comma-separated list:
<pre>
<!-- -->dt { display: inline; }
<!-- -->dt + dt:before { content: ", "; text-space-collapse: consume-before; }</pre>
</div>
<p class="issue">It's been pointed out that ''trim-inner'', ''consume-before'',
and ''consume-after'' won't work well because 'text-space-collapse' is
inherited, meaning that inserting a <span> or >div> would cause more
white space to be removed than otherwise.
<h3 id="white-space">
White Space and Text Wrapping Shorthand: the 'white-space' property</h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>white-space</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>normal | pre | nowrap | pre-wrap | pre-line</td>
</tr>
<tr>
<th>Initial:</th>
<td>not defined for shorthand properties</td>
</tr>
<tr>
<th>Applies to:</th>
<td>all elements</td>
</tr>
<tr>
<th>Inherited:</th>
<td>yes</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>see individual properties</td>
</tr>
</tbody>
</table>
<p>The 'white-space' property is a shorthand for the
'text-space-collapse' and 'text-wrap' properties.
Not all combinations are represented.
Values have the following meanings:</p>
<dl>
<dt><dfn title="white-space:normal">''normal''</dfn></dt>
<dd>Sets 'text-space-collapse' to ''collapse'' and
'text-wrap' to ''normal''</dd>
<dt><dfn title="white-space:pre">''pre''</dfn></dt>
<dd>Sets 'text-space-collapse' to ''preserve'' and
'text-wrap' to ''none''</dd>
<dt><dfn title="white-space:nowrap">''nowrap''</dfn></dt>
<dd>Sets 'text-space-collapse' to ''collapse'' and
'text-wrap' to ''none''</dd>
<dt><dfn title="white-space:pre-wrap">''pre-wrap''</dfn></dt>
<dd>Sets 'text-space-collapse' to ''preserve'' and
'text-wrap' to ''normal''</dd>
<dt><dfn title="white-space:pre-line">''pre-line''</dfn></dt>
<dd>Sets 'text-space-collapse' to ''preserve-breaks'' and
'text-wrap' to ''normal''</dd>
</dl>
<p>The following informative table summarizes the behavior of various
'white-space' values:</p>
<table class="data">
<colgroup class="header"></colgroup>
<colgroup span=3></colgroup>
<thead>
<tr>
<th></th>
<th>New Lines</th>
<th>Spaces and Tabs</th>
<th>Text Wrapping</th>
</tr>
</thead>
<tbody>
<tr>
<th>normal</th>
<td>Collapse</td>
<td>Collapse</td>
<td>Wrap</td>
</tr>
<tr>
<th>pre</th>
<td>Preserve</td>
<td>Preserve</td>
<td>No wrap</td>
</tr>
<tr>
<th>nowrap</th>
<td>Collapse</td>
<td>Collapse</td>
<td>No wrap</td>
</tr>
<tr>
<th>pre-wrap</th>
<td>Preserve</td>
<td>Preserve</td>
<td>Wrap</td>
</tr>
<tr>
<th>pre-line</th>
<td>Preserve</td>
<td>Collapse</td>
<td>Wrap</td>
</tbody>
</table>
<h2 id="hyphenation">Hyphenation</h2>
<p>Hyphenation allows the controlled splitting of words to improve the
layout of paragraphs. CSS3 Text does not define the exact rules for
hyphenation, but defines six properties and an at-rule that influence
hyphenation.
<p>Whether hyphenation is applied can controlled with the 'hyphens' property.
<p>The following author controls are not required to be supported for
the UA to claim conformance to CSS Text Level 4:
<ul>
<li>'hyphenate-limit-zone'
<li>'hyphenate-limit-chars'
<li>'hyphenate-limit-lines'
</ul>
<p>Nonetheless, UAs are strongly encouraged to optimize their line-breaking
implementation to choose good break points and appropriate hyphenation
points.
<p class="note">These controls are optional because for a low-end
implementation of hyphenation, they are not critical enough; and for
a high-end implementation of paragraph breaking (such as in
T<span style="font-variant: small-caps">e</span>χ) they are not
considered especially useful.</p>
<p>Hyphenation opportunities are not considered when calculating
''min-content'' intrinsic sizes.
<h3 id="hyphens">Hyphenation Control: the 'hyphens' property</h3>
<table class=propdef>
<tr>
<td>Name:
<td><dfn>hyphens</dfn>
<tr>
<th>Value:
<td>none | manual | auto
<tr>
<th>Initial:
<td>manual
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p>This property controls whether hyphenation is allowed to create more
break opportunities within a line of text. Values have the following
meanings:
<dl>
<dt><dfn title="hyphens:none">''none''</dfn>
<dd>Words are not broken at line breaks, even if characters inside
the word suggest line break points.
<dt><dfn title="hyphens:manual">''manual''</dfn>
<dd>Words are only broken at line breaks where there are characters
inside the word that suggest line break opportunities. Characters
can be explicit or conditional.
<div class="example">
<p>In Unicode, U+00AD is a conditional "soft hyphen" and U+2010 is an
explicit hyphen. Unicode Standard Annex #14 describes the
<a href="http://unicode.org/reports/tr14/#SoftHyphen">role of soft hyphens in</a>
Unicode line breaking. [[!UAX14]]
</div>
<div class="example">
<p>In HTML, &shy; represents the soft hyphen character which
suggests a line break opportunity.
<pre>ex&shy;ample</pre>
</div>
<dt><dfn title="hyphens:auto">''auto''</dfn>
<dd>Words can be broken at appropriate hyphenation points either as
determined by hyphenation characters inside the word or as
determined automatically by a language-appropriate hyphenation
resource.
Conditional hyphenation characters inside a word, if present,
take priority over automatic resources when determining
hyphenation points within the word.
</dl>
<p>Correct automatic hyphenation requires a hyphenation resource
appropriate to the language of the text being broken. The UA is
therefore only required to automatically hyphenate text for which
the author has declared a language (e.g. via HTML <code>lang</code>
or XML <code>xml:lang</code>) and for which it has an appropriate
hyphenation resource.
<p>When shaping scripts such as Arabic are allowed to break within words
due to hyphenation, the characters must still be shaped as if the word
were not broken.</p>
<h3 id="hyphenate-character">
Hyphens: the 'hyphenate-character' property</h3>
<table class=propdef>
<tr>
<th>Name:
<td><dfn>hyphenate-character</dfn>
<tr>
<th>Value:
<td>auto | <string>
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p>This property specifies strings that are shown between parts of
hyphenated words. The 'auto' value means that the user agent should
find an appropriate value, preferably from the same source as the
hyphenation dictionary. If a string is specified, it appears at
the end of the line before a hyphenation break.
<div class="example">
<p>In Latin scripts, the hyphen character (U+2010) is often used to
indicate that a word has been split. Normally, it will not be
necessary to set it explicitly. However, this can easily be done:
<pre>article { hyphenate-character: "\2010" }</pre>
</div>
<p class="note">Both hyphens triggered by automatic hyphenation and
hyphens triggered by soft hyphens are rendered according to
'hyphenate-character'.
<h3 id="hyphenate-size-limits">
Hyphenation Size Limit: the 'hyphenate-limit-zone' property</h3>
<table class=propdef>
<tr>
<th>Name:
<td><dfn>hyphenate-limit-zone</dfn>
<tr>
<th>Value:
<td><percentage> | <length>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td>block containers
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>refers to width of the line box
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p class="issue">Is 'hyphenate-limit-zone' a good name? Comments/suggestions?</p>
<p>This property specifies the maximum amount of unfilled space (before
justification) that may be left in the line box before hyphenation is
triggered to pull part of a word from the next line back up into the
current line.
<h3 id="hyphenate-char-limits">
Hyphenation Character Limits: the 'hyphenate-limit-chars' property</h3>
<table class=propdef>
<tr>
<th>Name:
<td><dfn>hyphenate-limit-chars</dfn>
<tr>
<th>Value:
<td>[auto | <integer>]{1,3}
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p>This property specifies the minimum number of characters in a
hyphenated word. If the word does not meet the required minimum
number of characters in the word / before the hyphen / after the
hyphen, then the word must not be hyphenated. Nonspacing combining
marks (<span class="issue">Unicode class</span>) and intra-word
punctuation (Unicode classes P*) do not count towards the minimum.
<p>If three values are specified, the first value is the required
minimum for the total characters in a word, the second value is
the minimum for characters before the hyphenation point, and
the third value is the minimum for characters after the hyphenation
point. If the third value is missing, it is the same as the second.
If the second value is missing, then it is ''auto''. The ''auto''
value means that the UA chooses a value that adapts to the current
layout.
<p class="note">Unless the UA is able to calculate a better value, it
is suggested that ''auto'' means 2 for before and after, and 5 for
the word total.
<div class="example">
<p>In the example below, the minimum size of a hyphenated word is
left to the UA (which means it may vary depending on the language,
the length of the line, or other factors), but the minimum number
of characters before and after the hyphenation point is set to 3.
<pre>p { hyphenate-limit-chars: auto 3; }</pre>
</div>
<h3 id="hyphenate-line-limits">
Hyphenation Line Limits: the 'hyphenate-limit-lines' and 'hyphenate-limit-last' properties</h3>
<table class=propdef>
<tr>
<th>Name:
<td><dfn>hyphenate-limit-lines</dfn>
<tr>
<th>Value:
<td>no-limit | <integer>
<tr>
<th>Initial:
<td>no-limit
<tr>
<th>Applies to:
<td>block containers
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p>This property indicates the maximum number of successive hyphenated
lines in an element. The ''no-limit'' value means that there is no limit.
<p>In some cases, user agents may not be able to honor the specified value.
(See 'overflow-wrap'.) It is not defined whether hyphenation introduced by
such emergency breaking influences nearby hyphenation points.
<table class=propdef>
<tr>
<th>Name:
<td><dfn>hyphenate-limit-last</dfn>
<tr>
<th>Value:
<td>none | always | column | page | spread
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>block containers
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p>This property indicates hyphenation behavior at the end of elements,
column, pages and spreads. A spread is a set of two pages that are
visible to the reader at the same time. Values are:
<dl>
<dt><dfn>''none''</dfn>
<dd>No restrictions imposed.
<dt><dfn>''always''</dfn>
<dd>The last full line of the element, or the last line before any
column, page, or spread break inside the element should not be
hyphenated.
<dt><dfn>''column''</dfn>
<dd>The last line before any column, page, or spread break inside
the element should not be hyphenated.
<dt><dfn>''page''</dfn>
<dd>The last line before page or spread break inside the element
should not be hyphenated.
<dt><dfn>''spread''</dfn>
<dd>The last line before any spread break inside the element should
not be hyphenated.
</dl>
<div class=example>
<pre>
<!-- -->p { hyphenate-limit-last: always }
<!-- -->div.chapter { hyphenate-limit-last: spread }</pre>
</div>
<div class=example>
<p>A paragraph may be formatted like this when 'hyphenate-limit-last: none' is set:
<pre>
<!-- -->This is just a
<!-- -->simple example
<!-- -->to show Antarc-
<!-- -->tica.
</pre>
<p>With 'hyphenate-limit-last: always' one would get:
<pre>
<!-- -->This is just a
<!-- -->simple example
<!-- -->to show
<!-- -->Antarctica.
</pre>
</div>
<h2 id="wrapping">
Text Wrapping</h2>
<p>Text wrapping is controlled by the 'text-wrap' and 'overflow-wrap' properties:</p>
<h3 id="text-wrap">
Text Wrap Settings: the 'text-wrap' property</h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:</th>
<td><dfn>text-wrap</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>normal | none | avoid</td>
</tr>
<tr>
<th>Initial:</th>
<td>normal</td>
</tr>
<tr>
<th>Applies to:</th>
<td>all elements</td>
</tr>
<tr>
<th>Inherited:</th>
<td>yes</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>specified value</td>
</tr>
</tbody>
</table>
<p>This property specifies the mode for text wrapping. Possible values:</p>
<dl>
<dt><dfn title="text-wrap:normal">''normal''</dfn></dt>
<dd>Lines may break at allowed break points, as determined by the
line-breaking rules in effect. Line breaking behavior defined
for the WJ, ZW, and GL line-breaking classes in
[[!UAX14]] must be honored.
<dt><dfn title="text-wrap:none">''none''</dfn></dt>
<dd>Lines may not break; text that does not fit within the block container
overflows it.</dd>
<dt><dfn title="text-wrap:avoid">''avoid''</dfn></dt>
<dd>Line breaking is suppressed within the element: the UA may only break
within the element if there are no other valid break points in the
line. If the text breaks, line-breaking restrictions are honored as for
'normal'.
</dl>
<p>Regardless of the 'text-wrap' value, lines always break at forced breaks:
for all values, line-breaking behavior defined for the BK, CR, LF, CM
NL, and SG line breaking classes in [[!UAX14]] must
be honored.</p>
<p>When <span class="property">'text-wrap'</span> is set to 'normal' or
'avoid', UAs that allow breaks at punctuation other than spaces
should prioritize breakpoints.
For example, if breaks after slashes have a lower priority than spaces,
the sequence "check /etc" will never break between the '/' and the 'e'.
The UA may use the width of the containing block, the text's language,
and other factors in assigning priorities.
As long as care is taken to avoid such awkward breaks, allowing breaks at
appropriate punctuation other than spaces is recommended, as it results
in more even-looking margins, particularly in narrow measures.</p>
<!-- add a sample prioritization algorithm -->
<h4 id="example-avoid">
Example of using 'text-wrap: avoid' in presenting a footer</h4>
<div class="example">
<p>The priority of breakpoints can be set to reflect the intended
grouping of text.</p>
<p>Given the rules</p>
<pre>
<!-- -->footer { text-wrap: avoid; /* inherits to all descendants */ }
</pre>
<p>and the following markup:</p>
<pre>
<!-- --><footer>
<!-- --> <venue>27th Internationalization and Unicode Conference</venue>
<!-- --> &#8226; <date>April 7, 2005</date> &#8226;
<!-- --> <place>Berlin, Germany</place>
<!-- --></footer>
</pre>
<p>In a narrow window the footer could be broken as</p>
<pre>
<!-- -->27th Internationalization and Unicode Conference •
<!-- -->April 7, 2005 • Berlin, Germany
</pre>
<p>or in a narrower window as</p>
<pre>
<!-- -->27th Internationalization and Unicode
<!-- -->Conference • April 7, 2005 •
<!-- -->Berlin, Germany
</pre>
<p>but not as</p>
<pre>
<!-- -->27th Internationalization and Unicode Conference • April
<!-- -->7, 2005 • Berlin, Germany
</pre>
</div>