forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.src.html
More file actions
1434 lines (1256 loc) · 56.8 KB
/
Overview.src.html
File metadata and controls
1434 lines (1256 loc) · 56.8 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
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CSS Text Decoration Module Level 3</title>
<link rel=contents href="#contents">
<!--<link rel=index href="#index">-->
<link rel="stylesheet" type="text/css" href="../default.css">
<link rel="stylesheet" type="text/css"
href="http://www.w3.org/StyleSheets/TR/W3C-[STATUS].css">
</head>
<body class="h-entry">
<div class="head">
<!--logo-->
<h1 class="p-name">CSS Text Decoration Module Level 3</h1>
<h2 class="no-num no-toc">[LONGSTATUS] <span class="dt-updated"><span class="value-title" title="[CDATE]">[DATE]</span></span></h2>
<dl>
<dt>This version:</dt>
<!--
<dd><a class="u-url" href="http://www.w3.org/TR/[YEAR]/WD-css-text-decor-3-[CDATE]/">http://www.w3.org/TR/[YEAR]/WD-css-text-decor-3-[CDATE]/</a></dd>
-->
<dd><a class="u-url" href="http://dev.w3.org/csswg/css-text-decor-3/">http://dev.w3.org/csswg/css-text-decor-3/</a>
<dt>Latest version:</dt>
<dd><a href="http://www.w3.org/TR/[SHORTNAME]/">http://www.w3.org/TR/[SHORTNAME]/</a></dd>
<dt>Latest editor's draft:</dt>
<dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a></dd>
<dt>Previous version:</dt>
<dd><a rel="previous"
href="http://www.w3.org/TR/2012/WD-css-text-decor-3-20121113/">http://www.w3.org/TR/2012/WD-css-text-decor-3-20121113/</a>
<dt>Issues List:</dt>
<dd><a rel="issues" href="http://www.w3.org/Style/CSS/Tracker/products/10">http://www.w3.org/Style/CSS/Tracker/products/10</a>
<dt>Feedback:</dt>
<dd><a href="mailto:www-style@w3.org?subject=%5B[css-text-decor]%5D%20feedback">www-style@w3.org</a>
with subject line “<kbd>[css-text-decor] <var>… message topic …</var></kbd>”
(<a rel="discussion" href="http://lists.w3.org/Archives/Public/www-style/">archives</a>)
<dt>Editors:</dt>
<dd class="p-author h-card vcard">
<a class="p-name fn u-url url" rel="author" href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a> (<span class="p-org org">Mozilla</span>)</dd>
<dd class="p-author h-card vcard">
<a class="p-name fn u-email email" rel="author" href="mailto:koji.a.ishii@mail.rakuten.com">Koji Ishii</a> (<span class="p-org org">Rakuten, Inc.</span>)</dd>
</dl>
<!--copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
<p>
<span class="p-summary">
This module contains the features of CSS relating to
text decoration, such as underlines, text shadows, and emphasis marks.
</span>
<a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing
the rendering of structured documents (such as HTML and XML) on screen, on
paper, in speech, etc.
<h2 class="no-num no-toc" id="status">Status of this document</h2>
<p><em>This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list of
current W3C publications and the latest revision of this technical report
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
index at http://www.w3.org/TR/.</a></em>
<p>Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite this
document as other than work in progress.
<p>This CSS module has been produced as a combined effort of the <a
href="http://www.w3.org/International/Activity">W3C Internationalization Activity</a>,
and the <a href="http://www.w3.org/Style/Activity">Style Activity</a> and is maintained
by the <a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a>. It also
includes contributions made by participants in the <a
href="http://www.w3.org/Style/XSL/Group/">XSL Working Group</a> (<a
href="http://cgi.w3.org/MemberAccess/AccessRequest">members
only</a>).
<p>This document was produced by a group operating under the <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a <a
href="http://www.w3.org/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.</p>
<p><strong>Feedback on this draft should be posted to the
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
public mailing list <a href="mailto:www-style@w3.org">www-style@w3.org</a></strong>
(see <a href="http://www.w3.org/Mail/Request">instructions</a>) <strong>with
<kbd>[text-decor-3]</kbd> in the subject line.</strong>
You are strongly encouraged to complain if you see something stupid
in this draft. The editors will do their best to respond to all feedback.</p>
<p>The following features are at risk and may be cut from the spec during
its CR period if there are no (correct) implementations:</p>
<ul>
<li>the 'text-decoration-skip' property
<li>the <a href="#line-position">line positioning rules</a>
<li>the ability to place both emphasis marks and ruby above the same base text
</ul>
<h2 class="no-num no-toc" id="contents">
Table of Contents</h2>
<!--toc-->
<h2 id="intro">
Introduction</h2>
<p><em>This subsection is non-normative.</em>
<p>This module covers text decoration, i.e. decorating the glyphs
of the text once typeset according to font and typographic rules.
(See [[CSS3TEXT]] and [[CSS3-FONTS]].)
Such features are traditionally used not only for purely decorative purposes,
but also in some cases to show emphasis, for honorifics,
and to indicate editorial changes such as insertions, deletions, and misspellings.
<p>CSS Levels 1 and 2 only defined very basic <a href="#line-decoration">line decorations</a>
(underlines, overlines, and strike-throughs)
appropriate to Western typographical traditions.
Level 3 of this module adds the ability to change
the color, style, position, and continuity of these decorations,
and also introduces
<a href="#emphasis-marks">emphasis marks</a> (traditionally used in East Asian typography),
and <a href="#text-shadow-property">shadows</a> (which were proposed then deferred from Level 2).
<h3 id="placement">
Module Interactions</h3>
<p>This module replaces and extends the text-decorating
features defined in [[!CSS21]] chapter 16.
<h3 id="values">
Values</h3>
<p>This specification follows the
<a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
definition conventions</a> from [[!CSS21]]. Value types not defined in
this specification are defined in CSS Level 2 Revision 1 [[!CSS21]].
Other CSS modules may expand the definitions of these value types: for
example [[CSS3COLOR]], when combined with this module, expands the
definition of the <color> value type as used in this specification.</p>
<p>In addition to the property-specific values listed in their definitions,
all properties defined in this specification also accept the
<a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a>
keyword as their property value. For readability it has not been repeated
explicitly.
<h3 id="terms">Terminology</h3>
<p>The terms <a href="http://www.w3.org/TR/css3-text/#grapheme-cluster"><dfn>character</dfn></a>,
<a href="http://www.w3.org/TR/css3-text/#letter"><dfn>letter</dfn></a>, and
<a href="http://www.w3.org/TR/css3-text/#content-language"><dfn>content language</dfn></a>
as used in this specification are defined in [[!CSS3TEXT]].
Other terminology and concepts used in this specification are defined
in [[!CSS21]] and [[!CSS3-WRITING-MODES]].
<h2 id="line-decoration">
Line Decoration: Underline, Overline, and Strike-Through</h2>
<p>
The following properties describe line decorations that are added to the content of an element.
When specified on or propagated to an inline box,
that box becomes a <dfn>decorating box</dfn> for that decoration,
applying the decoration to all its fragments.
The decoration is then further propagated to any in-flow block-level boxes that split the inline
(see <a href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level">CSS2.1 section 9.2.1.1</a>).
When specified on or propagated to a block container that establishes an inline formatting context,
the decorations are propagated to an anonymous inline box that wraps all the in-flow inline-level children of the block container.
When specified on or propagated to a ruby box,
the decorations are propagated only to the ruby base.
For all other box types,
the decorations are propagated to all in-flow children.
<p class="note">
Note that text decorations are not propagated to any out-of-flow descendants,
nor to the contents of atomic inline-level descendants such as inline blocks and inline tables.
They are also not propagated to inline children of inline boxes,
although the decoration is <em>applied</em> to such boxes.
<p>
By default underlines, overlines, and line-throughs are applied only to non-replaced inline boxes,
and are drawn over all text (including white space, letter spacing, and word spacing).
Atomic inlines, such as images, are not decorated.
The 'text-decoration-skip' property can be used to modify this behavior,
for example allowing atomic inlines to be underlined
or requiring that white space be skipped.
Margins, borders, and padding of the <i>decorating box</i> are always skipped.
<p>Relatively positioning a descendant moves all text decorations
applied to it along with the descendant's text; it does not affect
calculation of the decoration's initial position on that line.
The 'visibility' property, 'text-shadow', filters, and other graphical transformations
likewise affect text decorations as part of the text they're drawn on,
even if the decorations were specified on an ancestor box.
<div class="example">
<p>In the following style sheet and document fragment:</p>
<pre>
<!-- --> blockquote { text-decoration: underline; color: blue; }
<!-- --> em { display: block; }
<!-- --> cite { color: fuchsia; }</pre>
<pre>
<!-- --> <blockquote>
<!-- --> <p>
<!-- --> <span>
<!-- --> Help, help!
<!-- --> <em> I am under a hat! </em>
<!-- -->
<!-- --> <cite> —GwieF </cite>
<!-- --> </span>
<!-- --> </p>
<!-- --> </blockquote></pre>
<p>...the underlining for the blockquote element is propagated to an
anonymous inline box that surrounds the span element, causing
the text "Help, help!" to be blue, with the blue underlining from
the anonymous inline underneath it, the color being taken from the
blockquote element. The <code><em>text</em></code>
in the em block is also underlined, as it is in an in-flow block to
which the underline is propagated. The final line of text is fuchsia,
but the underline underneath it is still the blue underline from the
anonymous inline element.</p>
<p><img src="underline-example.png" alt="Sample rendering of the above underline example"></p>
<p>This diagram shows the boxes involved in the example above. The
rounded aqua line represents the anonymous inline element wrapping
the inline contents of the paragraph element, the rounded blue line
represents the span element, and the orange lines represent the
blocks.</p>
</div>
<h3 id="text-decoration-line-property">
Text Decoration Lines: the 'text-decoration-line' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-decoration-line</dfn>
<tr>
<th><a href="#values">Value</a>:
<td>none | [ underline || overline || line-through || blink ]
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no (but see prose)
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>no
</table>
<p>Specifies what line decorations, if any, are added to the element.
Values have the following meanings:</p>
<dl>
<dt><dfn title="text-decoration-line:none">''none''</dfn>
<dd>Neither produces nor inhibits text decoration.
<dt><dfn>''underline''</dfn>
<dd>Each line of text is underlined.
<dt><dfn>''overline''</dfn>
<dd>Each line of text has a line over it (i.e. on the opposite
side from an underline).
<dt><dfn>''line-through''</dfn>
<dd>Each line of text has a line through the middle.
<dt><dfn>''blink''</dfn>
<dd>
The text blinks (alternates between visible and invisible).
Conforming user agents may simply not blink the text.
Note that not blinking the text is one technique to satisfy <a href="http://www.w3.org/TR/UAAG/guidelines.html#tech-on-off-blinking-text">checkpoint 3.3 of WAI-UAAG</a>.
This value is <strong>deprecated</strong> in favor of Animations [[CSS3-ANIMATIONS]].
</dl>
<h3 id="text-decoration-color-property">
Text Decoration Color: the 'text-decoration-color' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-decoration-color</dfn>
<tr>
<th><a href="#values">Value</a>:
<td><a href="http://www.w3.org/TR/css3-color/#color0"><span class="value-inst-color"><color></span></a>
<tr>
<th>Initial:
<td><a href="http://www.w3.org/TR/css3-color/#currentcolor">currentColor</a>
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>the computed color
<tr>
<th>Animatable:
<td>as <a href="http://dev.w3.org/csswg/css3-transitions/#animtype-color">color</a>
</table>
<p>This property specifies the color of text decoration (underlines
overlines, and line-throughs) set on the element with
'text-decoration-line'.</p>
<p>
The color of text decorations must remain the same on all decorations originating from a given element,
even if descendant boxes have different specified colors.
<h3 id="text-decoration-style-property">
Text Decoration Style: the 'text-decoration-style' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-decoration-style</dfn>
<tr>
<th><a href="#values">Value</a>:
<td>solid | double | dotted | dashed | wavy
<tr>
<th>Initial:
<td>solid
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>no
</table>
<p>This property specifies the style of the line(s) drawn for
text decoration specified on the element. Values have the
same meaning as for the
<a href="http://www.w3.org/TR/css3-background/#the-border-style">border-style
properties</a> [[!CSS3BG]]. ''wavy'' indicates a wavy line.</p>
<p>
The style of text decorations must remain the same on all decorations originating from a given element,
even if descendant boxes have different specified styles.
<h3 id="text-decoration-property">
Text Decoration Shorthand: the 'text-decoration' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-decoration</dfn>
<tr>
<th><a href="#values">Value</a>:
<td><var><a href="#text-decoration-line"><text-decoration-line></a></var> ||
<var><a href="#text-decoration-style"><text-decoration-style></a></var> ||
<var><a href="#text-decoration-color"><text-decoration-color></a></var>
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>see individual properties
<tr>
<th>Animatable:
<td>see individual properties
</table>
<p>This property is a shorthand for setting 'text-decoration-line',
'text-decoration-color', and 'text-decoration-style' in one declaration.
Omitted values are set to their initial values. A 'text-decoration'
declaration that omits both the 'text-decoration-color'
and 'text-decoration-style' values is backwards-compatible
with CSS Levels 1 and 2.</p>
<div class="example">
<p>The following example underlines unvisited links with a solid blue
underline in CSS1 and CSS2 UAs and a navy dotted underline in CSS3 UAs.</p>
<pre><code class="css">
<!-- -->:link {
<!-- --> color: blue;
<!-- --> text-decoration: underline;
<!-- --> text-decoration: navy dotted underline; /* <a href="http://www.w3.org/TR/CSS21/syndata.html#ignore">Ignored</a> in CSS1/CSS2 UAs */
<!-- -->}</code></pre>
</div>
<h3 id="text-decoration-skip-property">
Text Decoration Line Continuity: the 'text-decoration-skip' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-decoration-skip</dfn>
<tr>
<th><a href="#values">Value</a>:
<td>none | [ objects || spaces || ink || edges || box-decoration ]
<tr>
<th>Initial:
<td>objects
<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>as specified
<tr>
<th>Animatable:
<td>no
</table>
<p>This property specifies what parts of the element's content
any text decoration affecting the element must skip over. It
controls all text decoration lines drawn by the element
and also any text decoration lines drawn by its ancestors.
Values have the following meanings:</p>
<dl>
<dt><dfn title="text-decoration-skip:none">''none''</dfn></dt>
<dd>Skip nothing: text-decoration is drawn for all text content
and across atomic inline-level boxes.</dd>
<dt><dfn title="text-decoration-skip:objects">''objects''</dfn></dt>
<dd>Skip this element (its entire margin box) if it is an atomic inline
(such as an image or inline-block).
<dt><dfn title="text-decoration-skip:spaces">''spaces''</dfn></dt>
<dd>Skip all spacing, i.e. all <i>characters</i> in Unicode general category Z [[UAX44]]
and all <i>word separator characters</i>,
plus any adjacent letter-spacing or word-spacing [[!CSS3TEXT]].
<dt><dfn title="text-decoration-skip:ink">''ink''</dfn></dt>
<dd>Skip over where glyphs are drawn: interrupt the decoration
line to let text show through where the text decoration would
otherwise cross over a glyph. The UA may also skip a small
distance to either side of the glyph outline.
<div class="figure">
<p><img title="text-decoration-skip: ink"
alt="An alphabetic underline through Myanmar text skips around descenders and the vertical strokes of combining characters that drop below the alphabetic baseline."
src="decoration-skip-ink.png"
>
<p class="caption">''text-decoration-skip: ink''</p>
</div>
<dt><dfn title="text-decoration-skip:edges">''edges''</dfn></dt>
<dd>The UA should place the start and end of the line inwards slightly
(e.g. by half a line thickness)
from the content edge of the <i>decorating element</i> so that,
e.g. two underlined elements side-by-side do not appear to have a single underline.
(This is important in Chinese, where underlining is a form of punctuation.)
<div class="figure">
<p><img title="text-decoration-skip: edges"
alt="An underline below a series of Chinese characters has a gap between two adjacent underlining elements."
src="decoration-skip-edges.png"
>
<p class="caption">''text-decoration-skip: edges'' for <code><u>石井</u><u>艾俐俐</u></code>
</p>
</div>
<dt><dfn title="text-decoration-skip:box-decoration">''box-decoration''</dfn>
<dd>
Skip over the box's margin, border, and padding areas.
Note that this only has an effect on decorations imposed by an ancestor;
a <i>decorating element</i> never draws over its own box decoration.
</dl>
<p class="note">Note that this property inherits and that descendant
elements can have a different setting.</p>
<p class='note'>
Note that CSS 2.1 required skipping margins, borders, and padding always.
In this level, by default only the margins, borders, and padding of the <i>decorating element</i> are skipped.
In the future CSS2.1 may be updated to match this new default.
<h3 id="text-underline-position-property">
Text Underline Position: the 'text-underline-position' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-underline-position</dfn>
<tr>
<th><a href="#values">Value</a>:
<td>auto | alphabetic | [ under || [ left | right ] ]
<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>as specified
<tr>
<th>Animatable:
<td>no
</table>
<p>This property sets the position of an underline specified
on the same element: it does not affect underlines specified by
ancestor elements. Values have the following meanings:</p>
<dl>
<dt><dfn id="underline-auto" title="text-underline-position: auto">''auto''</dfn></dt>
<dd>The user agent may use any algorithm to determine the
underline's position; however it must be placed at or under
the alphabetic baseline.
<p class="note">It is suggested that the underline position
be ''alphabetic'' unless it crosses either subscripted (or
otherwise lowered) text, or it affects characters from Asian
scripts such as Han or Tibetan, for which an alphabetic
underline is too high: in such cases, aligning to the em box
edge as described for ''under left'' is more appropriate.
<dt><dfn id="underline-alphabetic" title="text-underline-position: alphabetic">''alphabetic''</dfn></dt>
<dd>The underline is positioned relative to the alphabetic baseline. In
this case the underline is likely to cross some descenders.
<div class="figure">
<p><img title="text-underline-position: alphabetic"
alt="In a typical Latin font, the underline is positioned slightly
below the alphabetic baseline, leaving a gap between the line
and the bottom of most Latin letters, but crossing through
descenders such as the stem of a 'p'."
src="underline-position-alphabetic.png"
>
<p class="caption">''text-underline-position: alphabetic''</p>
</div>
<dt><dfn id="underline-under" title="text-underline-position: under">''under''</dfn></dt>
<dd>In horizontal writing modes, the underline is positioned
relative to the under edge of the element's content box.
In this case the underline usually does not cross the descenders.
(This is sometimes called "accounting" underline.)
If the underline affects descendants with a lower content edge,
the user agent should shift the underline down further to the
lowest underlined content box edge.
The user agent may ignore elements with ''vertical-align''
values given as lengths, percentages, ''top'', or ''bottom''
when making this adjustment.
(Note that images that are not affected by the underline per
'text-decoration-skip' will not affect the position of the
underline.)
<div class="figure">
<p><img title="text-underline-position: under"
alt="In a typical Latin font, the underline is far enough
below the text that it does not cross the bottom of a 'g'."
src="underline-position-under.png"
>
<p class="caption">''text-underline-position: under''</p>
</div>
<div class="example">
<p>Because 'text-underline-position' inherits, and is not reset
by the 'text-decoration' shorthand, the following example
switches the document to use ''under'' underlining, which can
be more appropriate for writing systems with long, complicated
descenders. It is also often useful for mathematical or chemical
texts that use many subscripts.
<pre>:root { text-underline-position: under; }</pre>
</div>
<dt><dfn id="underline-left" title="text-underline-position: left">''left''</dfn></dt>
<dd>In vertical writing modes, the underline is aligned as for
''under'', except it is always aligned to the left edge of the text.
If this causes the underline to be drawn on the "over" side of
the text, then an overline also switches sides and is drawn on
the "under" side.
<dt><dfn id="underline-right" title="text-underline-position: right">''right''</dfn></dt>
<dd>In vertical writing modes, the underline is aligned as for
''under'', except it is always aligned to the right edge of the text.
If this causes the underline to be drawn on the "over" side of
the text, then an overline also switches sides and is drawn on
the "under" side.</dd>
</dl>
<p>If ''under'' is specified alone, ''left'' is also implied.
If ''left'' or ''right'' is specified alone, ''under'' is also
implied.
<div class="figure" id="fig-text-underline-position">
<table>
<tr>
<td>
<img alt="In mixed Japanese-Latin vertical text, 'text-underline-position: left'
places the underline on the left side of the text."
title="text-underline-position: left"
src="underline-position-left.png"
>
<td>
<img alt="In mixed Japanese-Latin vertical text, 'text-underline-position: right'
places the underline on the right side of the text."
title="text-underline-position: right"
src="underline-position-right.png"
>
<tr>
<td>''left''
<td>''right''
</table>
<p class="caption">In vertical writing modes, the 'text-underline-position'
values ''left'' and ''right'' allow placing the underline on either
side of the text. (In horizontal writing modes, both values are
treated as ''under''.)</p>
</div>
<div class="example">
<p>The following example styles modern Chinese, Japanese, and Korean
texts with the appropriate underline positions in both horizontal
and vertical text:
<pre>:root:lang(ja), [lang|=ja], :root:lang(ko), [lang|=ko] { text-underline-position: under right; }
<!-- -->:root:lang(zh), [lang|=zh] { text-underline-position: under left; }</pre>
</div>
<h3 id="line-position">
Determining the Position and Thickness of Line Decorations</h3>
<p>In determining the position of text decoration lines,
user agents must consider, per line box, the "ideal" positions of all fragments
of in-flow inline descendants of the <i>decorating box</i> on that line
as follows
(treating <a href="#underline-left"><i>over</i>-positioned underlines</a> as <i>over</i> lines
and <a href="#underline-left"><i>under</i>-positioned overlines</a> as <i>under</i> lines):
<dl>
<dt><a href="http://dev.w3.org/csswg/css3-writing-modes/#over"><i>over</i></a> lines
<dd>
Align the line decoration with respect to the highest
<!-- <i>text-over</i> baseline of the considered fragments. -->
<a href="http://dev.w3.org/csswg/css3-writing-modes/#over"><i>over</i></a> edge
of the considered fragments' EM boxes.
<dt><a href="#underline-alphabetic"><i>alphabetic</i></a> underlines
<dd>
Calculate an average of the ideal underlining offsets
(from their respective alphabetic baselines)
of the considered fragments,
assigning any inline with non-initial 'vertical-align' the ideal offset of its parent.
Align the line decoration to the lowest alphabetic baseline considered,
with that calculated offset.
(Alphabetic baselines can differ between ''baseline''-aligned boxes if the dominant baseline is non-alphabetic.)
<dt>non-alphabetic <a href="http://dev.w3.org/csswg/css3-writing-modes/#under"><i>under</i></a> lines
<dd>
Position the line decoration with respect to the lowest
<!-- <i>text-under</i> baseline of the considered fragments. -->
<a href="http://dev.w3.org/csswg/css3-writing-modes/#under"><i>under</i></a> edge
of the considered fragments' EM boxes.
<dt>line-throughs
<dd>
For each set of considered fragments with the same 'font-size',
compute an ideal position averaged from their direct contents and font metrics,
assigning any fragment with non-initial 'vertical-align' the ideal position of its parent.
Position the portion of the line across each decorated fragment at that fragment's ideal position.
(Essentially, this performs the same sort of averaging as for alphabetic underlines,
but recomputes the position when drawing across a descendant with a different computed 'font-size'.
This ensures that the text remains effectively "crossed out" despite any font size changes.)
</dl>
<p>
CSS does not define the thickness of line decorations.
In determining the thickness of text decoration lines,
user agents may consider the font sizes, faces, and weights of descendants
to provide an appropriately averaged thickness.
<div class="example">
<p>The following figure shows the averaging for underline:
<p><img alt="In the first rendering of the underlined text '1st a'
with 'st' as a superscript, both the '1st' and the 'a'
are rendered in a small font. In the second rendering,
the 'a' is rendered in a larger font. In the third, both
'1st' and 'a' are large."
height="105" src="underline-averaging.gif" width="326">
<p>In the three fragments of underlined text, the underline is drawn
consecutively lower and thicker as the ratio of large text to small
text increases.</p>
<p>Using the same example, a line-through would in the second fragment,
instead of averaging the two font sizes,
split the line-through into two segments:
<p><img alt="" src="linethrough-averaging.gif">
<p>In both cases, however, the superscript, due to the vertical-alignment shift,
has no effect on the position of the line.
</div>
<div class="note">
<p>In some cases (such as in OpenType) the font format can offer
information about the appropriate position of an underline.
Typically this information gives the position of an ''alphabetic''
underline; in some cases (especially in CJK fonts), it gives
the position of a ''under left'' underline. (In this case,
the font's underline metrics typically touch the bottom edge
of the em box).
The UA is encouraged to use information (such as the underline
thickness, or appropriate alphabetic alignment) from the font
wherever appropriate.
The same applies to line throughs.
</p>
</div>
<h2 id="emphasis-marks">
Emphasis Marks</h2>
<p>East Asian documents traditionally use small symbols next to each glyph to emphasize
a run of text. For example:</p>
<div class="figure">
<p>
<img alt="Example of emphasis in Japanese appearing over the text"
class="example" src="text-emphasis-ja.gif" height="28" width="225"></p>
<p class="caption">Accent emphasis (shown in blue for clarity) applied to Japanese text</p>
</div>
<h3 id="text-emphasis-style-property">
Emphasis Mark Style: the 'text-emphasis-style' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-emphasis-style</dfn>
<tr>
<th><a href="#values">Value</a>:
<td>none |
[ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] |
<a class="noxref" href="http://www.w3.org/TR/CSS21/syndata.html#value-def-string"><span class="value-inst-string"><string></span></a>
<tr>
<th>Initial:
<td>none
<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>'none', a pair of keywords representing the shape and fill, or
a string
<tr>
<th>Animatable:
<td>no
</table>
<p>This property applies emphasis marks to the element's text.
Values have the following meanings:</p>
<dl>
<dt><dfn title="text-emphasis:none">''none''</dfn></dt>
<dd>No emphasis marks.</dd>
<dt><dfn title="text-emphasis:filled">''filled''</dfn></dt>
<dd>The shape is filled with solid color.</dd>
<dt><dfn title="text-emphasis:open">''open''</dfn></dt>
<dd>The shape is hollow.</dd>
<dt><dfn title="text-emphasis:dot">''dot''</dfn></dt>
<dd>Display small circles as marks.
The filled dot is U+2022 '•', and the open dot is U+25E6 '◦'.</dd>
<dt><dfn title="text-emphasis:circle">''circle''</dfn></dt>
<dd>Display large circles as marks.
The filled circle is U+25CF '●', and the open circle is U+25CB '○'.</dd>
<dt><dfn title="text-emphasis:double-circle">''double-circle''</dfn></dt>
<dd>Display double circles as marks.
The filled double-circle is U+25C9 '◉', and the open double-circle is U+25CE '◎'.</dd>
<dt><dfn title="text-emphasis:triangle">''triangle''</dfn></dt>
<dd>Display triangles as marks.
The filled triangle is U+25B2 '▲', and the open triangle is U+25B3 '△'.</dd>
<dt><dfn title="text-emphasis:sesame">''sesame''</dfn></dt>
<dd>Display sesames as marks.
The filled sesame is U+FE45 '﹅', and the open sesame is U+FE46 '﹆'.</dd>
<dt><dfn title="text-emphasis:sesame">''<var><string></var>''</dfn></dt>
<dd>Display the given string as marks.
Authors should not specify more than one <i>character</i> in <string>.
The UA may truncate or ignore strings consisting of more than one grapheme cluster.</dd>
</dl>
<p>If a shape keyword is specified but neither of ''filled'' nor ''open'' is
specified, ''filled'' is assumed. If only ''filled'' or ''open'' is specified,
the shape keyword computes to ''circle'' in horizontal writing mode and
''sesame'' in vertical writing mode.</p>
<p>The marks should be drawn using the element's font settings with its
size scaled down to 50%. However, not all fonts have all these glyphs,
and some fonts use inappropriate sizes for emphasis marks in these
code points. The UA may opt to use a font known to be good for
emphasis marks, or the marks may instead be synthesized by the UA.
Marks must remain upright in vertical writing modes: like CJK
characters, they do not rotate to match the writing mode.</p>
<p class="note">
One example of good fonts for emphasis marks is Adobe's opensource project,
<a href="http://sourceforge.net/adobe/kenten-generic/">Kenten Generic OpenType Font</a>,
which is specially designed for the emphasis marks.
</p>
<p>The marks are drawn once for each <i>character</i>. However,
emphasis marks are not drawn for characters that are:</p>
<ul>
<li><a href="http://www.w3.org/TR/css3-text/#word-separator">Word separators</a> or that
belong to the Unicode separator classes (Z*).
(But note that emphasis marks <em>are</em> drawn for a space
that combines with any combining characters.)</li>
<li>Characters belonging to the Unicode classes for control codes
and unassigned characters (Cc, Cf, Cn).</li>
</ul>
<h3 id="text-emphasis-color-property">
Emphasis Mark Color: the 'text-emphasis-color' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-emphasis-color</dfn>
<tr>
<th><a href="#values">Value</a>:
<td><color>
<tr>
<th>Initial:
<td><a href="http://www.w3.org/TR/css3-color/#currentcolor">currentColor</a>
<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>as specified
<tr>
<th>Animatable:
<td>as <a href="http://dev.w3.org/csswg/css3-transitions/#animtype-color">color</a>
</table>
<p>This property specifies the foreground color of the emphasis marks.</p>
<p class="note">
The <dfn>''currentcolor''</dfn> keyword computes to itself
and is resolved to the value of 'color' after inheritance is performed.
This means 'text-emphasis-color' by default matches the text 'color'
even as 'color' changes across elements.
<h3 id="text-emphasis-property">
Emphasis Mark Shorthand: the 'text-emphasis' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-emphasis</dfn>
<tr>
<th><a href="#values">Value</a>:
<td>'<<a href="#text-emphasis-style">text-emphasis-style</a>>' || '<<a href="#text-emphasis-color">text-emphasis-color</a>>'
<tr>
<th>Initial:
<td>see individual properties
<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>see individual properties
<tr>
<th>Animatable:
<td>see individual properties
</table>
<p>This property is a shorthand for setting
'text-emphasis-style' and 'text-emphasis-color'
in one declaration.
Omitted values are set to their initial values.</p>
<p class="note">Note that 'text-emphasis-position' is not reset in this
shorthand. This is because typically the shape and color vary, but the
position is consistent for a particular language throughout the document.
Therefore the position should inherit independently.</p>
<h3 id="text-emphasis-position-property">
Emphasis Mark Position: the 'text-emphasis-position' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td><dfn>text-emphasis-position</dfn>
<tr>
<th><a href="#values">Value</a>:
<td>[ over | under ] && [ right | left ]
<tr>
<th>Initial:
<td>over right
<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>as specified
<tr>
<th>Animatable:
<td>no