forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.html
More file actions
executable file
·3362 lines (2521 loc) · 186 KB
/
Overview.html
File metadata and controls
executable file
·3362 lines (2521 loc) · 186 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><html lang=en><head>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Inline Layout Module Level 3</title>
<link href=../default.css rel=stylesheet type=text/css>
<link href=../csslogo.ico rel="shortcut icon" type=image/x-icon>
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
background-attachment: fixed;
color: black;
font-family: sans-serif;
margin: 0 auto;
max-width: 50em;
padding: 2em 1em 2em 70px;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a[href]:active { color: #C00; background: transparent }
a[href]:hover { background: #ffa }
a[href] img { border-style: none }
h1, h2, h3, h4, h5, h6 { text-align: left }
h1, h2, h3 { color: #005A9C; }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
pre { margin-left: 2em }
dt { font-weight: bold }
ul.toc, ol.toc {
list-style: none;
}
</style>
<style media=print type=text/css>
img#edge { width: 80%; height: 70%;}
dt.label { display: run-in; }
</style>
</head>
<body class=h-entry>
<div class=head>
<p data-fill-with=logo><a class=logo href=http://www.w3.org/>
<img alt=W3C height=48 src=https://www.w3.org/Icons/w3c_home width=72>
</a>
</p>
<h1 class="p-name no-ref" id=title>CSS Inline Layout Module Level 3</h1>
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
<span class=dt-updated><span class=value-title title=20140905>5 September 2014</span></span></span></h2>
<div data-fill-with=spec-metadata><dl>
<dt>This version:
<dd><a class=u-url href=http://dev.w3.org/csswg/css-inline/>http://dev.w3.org/csswg/css-inline/</a>
<dt>Latest version:
<dd><a href=http://www.w3.org/TR/css-inline/>http://www.w3.org/TR/css-inline/</a>
<dt>Previous Versions:
<dd><dd><a href=http://www.w3.org/TR/2002/WD-css3-linebox-20020515/ rel=previous>http://www.w3.org/TR/2002/WD-css3-linebox-20020515/</a>
<dt>Feedback:
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-inline%5D%20feedback">www-style@w3.org</a>
with subject line
“<kbd>[css-inline] <var>… message topic …</var></kbd>”(<a href=http://lists.w3.org/Archives/Public/www-style/ rel=discussion>archives</a>)
<dt>Editors:
<dd><dd class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:dauwhe@gmail.com>Dave Cramer</a> (<span class="p-org org">Hachette Livre</span>)
<dd><dd class="p-author h-card vcard"><a class="p-name fn u-url url" href=http://fantasai.inkedblade.net/contact>Elika J. Etemad</a> (<span class="p-org org">Invited Expert</span>)
<dd><dd class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:szilles@adobe.com>Steve Zilles</a> (<span class="p-org org">Adobe</span>)
<dt>Issues list:
<dd><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Linebox&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED">CSS3 Line Layout issues in Bugzilla</a>
</dl>
</div>
<div data-fill-with=warning></div>
<p class=copyright data-fill-with=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2014 <a href=http://www.w3.org/><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href=http://www.csail.mit.edu/><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href=http://www.ercim.eu/><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href=http://www.keio.ac.jp/>Keio</a>, <a href=http://ev.buaa.edu.cn/>Beihang</a>), All Rights Reserved. W3C <a href=http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer>liability</a>, <a href=http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks>trademark</a> and <a href=http://www.w3.org/Consortium/Legal/copyright-documents>document use</a> rules apply.
</p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled heading" id=abstract><span class=content>Abstract</span></h2>
<div class=p-summary data-fill-with=abstract><p>The CSS formatting model provides for a flow of elements and text inside of a container to be wrapped into lines. The formatting of elements and text within a line, its positioning in the inline progression direction, and the breaking of lines are described in <a data-biblio-type=informative data-link-type=biblio href=#biblio-css3text title=biblio-CSS3TEXT>[CSS3TEXT]</a>. This module describes the positioning in the block progression direction both of elements and text within lines and of the lines themselves. This positioning is often relative to a baseline. It also describes special features for formatting of first lines and drop caps. It extends on the model in <a data-biblio-type=informative data-link-type=biblio href=#biblio-css2 title=biblio-CSS2>[CSS2]</a>.</p>
<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.</div>
<h2 class="no-num no-toc no-ref heading settled heading" id=status><span class=content>Status of this document</span></h2>
<div data-fill-with=status><p>
This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
<p>
The (<a href=http://lists.w3.org/Archives/Public/www-style/>archived</a>) public mailing list
<a href="mailto:www-style@w3.org?Subject=%5Bcss-inline%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>
(see <a href=http://www.w3.org/Mail/Request>instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-inline” in the subject,
preferably like this:
“[css-inline] <em>…summary of comment…</em>”
<p>
This document was produced by the <a href=http://www.w3.org/Style/CSS/members>CSS Working Group</a>
(part of the <a href=http://www.w3.org/Style/>Style Activity</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>.</div>
<div data-fill-with=at-risk></div>
<h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class=content>Table of Contents</span></h2>
<div data-fill-with=table-of-contents><ul class=toc>
<li><a href=#LineBox><span class=secno>1</span> Line box, Line stacking and Content height</a>
<ul class=toc>
<li><a href=#InlineFormatting><span class=secno>1.1</span> Inline formatting context</a>
<li><a href=#LineBoxWrapping><span class=secno>1.2</span> Inline-progression: Line Box wrapping</a>
<li><a href=#inline1><span class=secno>1.3</span> Block-progression dimensions: the <span class=property data-link-type=propdesc title=text-height>text-height</span> property</a>
<li><a href=#LineBoxHeight><span class=secno>1.4</span> Block progression positioning and spacing</a>
<ul class=toc>
<li><a href=#InlineBoxHeight><span class=secno>1.4.1</span> Line height adjustment: the <span class=property data-link-type=propdesc title=line-height>line-height</span> property</a>
<li><a href=#LineStacking><span class=secno>1.4.2</span> Line Stacking: the <span class=property data-link-type=propdesc title=line-box-contain>line-box-contain</span> property</a>
<ul class=toc>
<li><a href=#old-remove-this><span class=secno>1.4.2.1</span> Old, remove this:</a></ul></ul></ul>
<li><a href=#baseline><span class=secno>2</span> Baseline alignment</a>
<ul class=toc>
<li><a href=#FontBaseline><span class=secno>2.1</span> Baseline information provided by fonts</a>
<li><a href=#AlignmentBaselineType><span class=secno>2.2</span> Baseline identifiers</a>
<li><a href=#BaselineAlignmentOverview><span class=secno>2.3</span> Overview of the baseline alignment process</a>
<li><a href=#dominant-baseline-prop><span class=secno>2.4</span> Dominant baseline: the <span class=property data-link-type=propdesc title=dominant-baseline>dominant-baseline</span> property</a>
<li><a href=#alignment-baseline-prop><span class=secno>2.5</span> Aligning the alignment point of an element: the <span class=property data-link-type=propdesc title=alignment-baseline>alignment-baseline</span> property</a>
<li><a href=#alignment-adjust-prop><span class=secno>2.6</span> Setting the alignment point: the <span class=property data-link-type=propdesc title=alignment-adjust>alignment-adjust</span> property</a>
<li><a href=#baseline-shift-prop><span class=secno>2.7</span> Repositioning the dominant baseline: the <span class=property data-link-type=propdesc title=baseline-shift>baseline-shift</span> property</a>
<li><a href=#vertical-align-prop><span class=secno>2.8</span> Vertical alignment: the <span class=property data-link-type=propdesc title=vertical-align>vertical-align</span> shorthand baseline alignment property</a>
<li><a href=#inline-box-align-prop><span class=secno>2.9</span> Inline box alignment: the <span class=property data-link-type=propdesc title=inline-box-align>inline-box-align</span> property</a></ul>
<li><a href=#Initial><span class=secno>3</span> Initial Lines and Initial Letters</a>
<ul class=toc>
<li><a href=#InitialLine><span class=secno>3.1</span> Initial Lines</a>
<li><a href=#DropInitial><span class=secno>3.2</span> An Introduction to Initial Letters</a>
<li><a href=#selecting-drop-initials><span class=secno>3.3</span> Selecting Initial Letters</a>
<li><a href=#sizing-drop-initials><span class=secno>3.4</span> Creating Initial Letters: The <span class=property data-link-type=propdesc title=initial-letter>initial-letter</span> shorthand</a>
<li><a href=#the-initial-letter-drop-property><span class=secno>3.5</span> The initial-letter-drop property</a>
<li><a href=#the-initial-letter-size-property><span class=secno>3.6</span> The initial-letter-size property</a>
<li><a href=#aligning-initial-letter><span class=secno>3.7</span> Alignment of Initial Letters</a>
<li><a href=#initial-letter-exclusions><span class=secno>3.8</span> Space Around Initial Letters</a>
<li><a href=#initial-letter-paragraphs><span class=secno>3.9</span> Interactions of initial letters with surrounding paragraphs</a>
<ul class=toc>
<li><a href=#raised-and-sunken-caps><span class=secno>3.9.1</span> Raised and sunken caps</a>
<li><a href=#short-paragraphs-with-initial-letters><span class=secno>3.9.2</span> Short paragraphs with initial letters</a></ul></ul>
<li><a href=#properties><span class=secno>4</span> Properties index</a>
<li><a href=#profiles><span class=secno>5</span> Profiles</a>
<li><a href=#BaselineUsage><span class=secno></span> Appendix A: Usage of baseline alignment (informative)</a>
<li><a href=#ack><span class=secno></span> Acknowledgments</a>
<li><a href=#conformance><span class=secno></span> Conformance</a>
<ul class=toc>
<li><a href=#conventions><span class=secno></span> Document conventions</a>
<li><a href=#conformance-classes><span class=secno></span> Conformance classes</a>
<li><a href=#partial><span class=secno></span> Partial implementations</a>
<li><a href=#experimental><span class=secno></span> Experimental implementations</a>
<li><a href=#testing><span class=secno></span> Non-experimental implementations</a></ul>
<li><a href=#references><span class=secno></span> References</a>
<ul class=toc>
<li><a href=#normative><span class=secno></span> Normative References</a>
<li><a href=#informative><span class=secno></span> Informative References</a></ul>
<li><a href=#index><span class=secno></span> Index</a>
<li><a href=#property-index><span class=secno></span> Property index</a>
<li><a href=#issues-index><span class=secno></span> Issues Index</a></ul></div>
<h2 class="heading settled heading" data-level=1 id=LineBox><span class=secno>1 </span><span class=content>Line box, Line stacking and Content height</span><a class=self-link href=#LineBox></a></h2>
<p>This section describes inline boxes formatting, how lines are stacked
together and a mechanism to adjust the content height of inline elements. Two
terms: inline-progression dimension and block-progression dimension are used
frequently in the section and are defined as follows
<p>The <b>inline-progression
dimension</b> is a length in the direction of the inline-progression of a box.
For an horizontal layout flow it can be perceived as related to the the width of
the box. However for a vertical layout flow it will be related to the height of
the box. The term inline-progression dimension is the neutral way to express
that dimension independently of the layout flow.
<p>The <b>block-progression dimension</b> is a length in the direction of the
block-progression of a box. For an horizontal layout flow it can be perceived as
related to the height of the box. However for a vertical layout flow it will be
related to the width of the box. The term block-progression dimension is the
neutral way to express that dimension independently of the layout flow.
<h3 class="heading settled heading" data-level=1.1 id=InlineFormatting><span class=secno>1.1 </span><span class=content>Inline formatting context</span><a class=self-link href=#InlineFormatting></a></h3>
<p>In an inline formatting context, boxes are laid out in the inline-progression
direction, one after
the other, following the block-progression within the containing block. Borders,
padding and inline-progression margins are respected between these boxes. The boxes may be aligned
within the inline-progression in different ways: their under-edges or
over-edges may be aligned, or the
baselines of text within them may be aligned. The rectangular area that contains
the boxes that form a line is called a <dfn data-dfn-type=dfn data-noexport="" id=line-box>line box<a class=self-link href=#line-box></a></dfn>.
<p>The inline-progression dimension (<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css2/visudet.html#propdef-width title=width>width</a> in horizontal flow) of a line box is
determined by its containing block. The block-progression dimension (<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css2/visudet.html#propdef-height title=height>height</a> in
horizontal flow) of a line box is determined by the rules given
in the section on
<a href=#line-height>line height
calculations</a>. A line box is generally tall (relative) enough for all of the boxes it
contains. However, it may be taller than the tallest box it contains (if, for
example, boxes are aligned so that baselines line up). The alignment of boxes
within a line box is determined by the
<a href=#baseline>baseline alignment</a> properties.</p>
<p>In general, when several inline boxes cannot fit within a single line box,
they are distributed among two or more block-progression stacked line boxes. The
exact wrapping of inline boxes at the line ending edge is determined by several
text related property categories such as line-breaking, word-breaking, text
wrapping and white-space management. Thus, a
paragraph is a stack of line boxes.</p>
<p>Line boxes are stacked together in the block-progression direction
without any separation. The block-progression dimension of the line box
is determined by the contents of the line box (including the root inline
box) and the <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a> property.</p>
<p>A containing block defines a <b>root inline box</b> which wraps all the
inline children of the block element, including the anonymous inline boxes.
It inherits inheritable properties from the parent block
box (like <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a>), while non-inherited
properties have their default values. The root inline box establishes a
baseline for vertical alignment and may affect the height of the line
boxes.</p>
<p>Although margins, borders, and padding of non-replaced elements do not enter
into inline box block-progression dimension calculation (and thus the line box
calculation), they are still rendered around inline boxes. This means that if
the block-progression dimension of a line box is shorter than the
<a href=http://www.w3.org/TR/REC-CSS2/box.html#outer-edge>outer edges</a> of
the boxes it contains, backgrounds and colors of padding and borders may "bleed"
into adjacent line boxes. However, in this case, some user agents may use the
line box to "clip" the border and padding areas (i.e., not render them). </p>
<h3 class="heading settled heading" data-level=1.2 id=LineBoxWrapping><span class=secno>1.2 </span><span class=content>Inline-progression: Line Box wrapping</span><a class=self-link href=#LineBoxWrapping></a></h3>
<p>In general, the start edge of a line box touches the start edge of its
containing block and the end edge touches the end edge of its containing block.
However, floating boxes may come between the containing block edge and the line
box edge. Thus, although line boxes in the same inline formatting context
generally have the same inline-progression dimension (that of the
containing block), they may vary if available inline-progression space
is reduced due to
floats. Line boxes in the same inline formatting context may vary in
block-progression dimension.</p>
<p>When the total inline-progression dimension of the inline boxes on a line is less than the
inline-progression dimension of
the line box containing them, their inline-progression distribution within the line box
is determined by the
<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-text-3/#propdef-text-align title=text-align>text-align</a> property. If that
property has the value <span class=css data-link-type=maybe title=justify>justify</span>, the user agent may stretch the inline boxes as
well. </p>
<p>When line-breaking opportunities are available within inline boxes and are
not pre-empted by the white-space properties, the inline boxes located at the
ending edge of the line box may be split into several boxes and these boxes
distributed across several line boxes. When an inline box is split, margins, borders, and padding have no visual
effect where the split occurs (or at any split, when they are several). Formatting of margins, borders, and padding may
not be fully defined if the split occurs within a bidirectional embedding. </p>
<p>Inline boxes may also be split into several boxes <em>within the same line
box</em> due to <a href=#direction>bidirectional text processing</a>. </p>
<div class=html-example>
Here is an example of inline box construction. The following paragraph
(created by the HTML block-level element P) contains anonymous text
interspersed with the elements EM and STRONG:
<pre><P>Several <EM>emphasized words</EM> appear
<STRONG>in this</STRONG> sentence, dear.</P>
</pre>
<p>The P element generates a block box that contains five inline boxes, three
of which are anonymous:</p>
<ul>
<li>Anonymous: "Several" </li>
<li>EM: "emphasized words" </li>
<li>Anonymous: "appear" </li>
<li>STRONG: "in this" </li>
<li>Anonymous: "sentence, dear." </li>
</ul>
<p>To format the paragraph, the user agent flows the five boxes into line
boxes. In this example, the box generated for the P element establishes the
containing block for the line boxes. If the containing block is sufficiently
wide (relative) , all the inline boxes will fit into a single line box: </p>
<pre> Several <em>emphasized words</em> appear <strong>in this</strong> sentence, dear.
</pre>
<p>If not, the inline boxes will be split up and distributed across several
line boxes. The previous paragraph might be split as follows: </p>
<pre>Several <em>emphasized words</em> appear
<strong>in this</strong> sentence, dear.
</pre>
<p>or like this: </p>
<pre>Several <em>emphasized</em>
<em>words</em> appear <strong>in this</strong>
sentence, dear.
</pre>
</div>
<p>In the previous example, the EM box was split into two EM boxes (call them
"split1" and "split2"). Margins, borders, padding, or text decorations have no
visible effect after split1 or before split2. </p>
<div class=html-example>
Consider the following example:
<pre><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<TITLE>Example of inline flow on several lines</TITLE>
<STYLE type="text/css">
EM {
padding: 2px;
margin: 1em;
border-width: medium;
border-style: dashed;
line-height: 2.4em;
}
</STYLE>
</HEAD>
<BODY>
<P>Several <EM>emphasized words</EM> appear here.</P>
</BODY>
</HTML>
</pre>
<p>Depending on the width of the P, the boxes may be distributed as follows:</p>
<div class=figure>
<img alt="Image illustrating the effect of line breaking on the
display of margins, borders, and padding." height=99 src=inline-layout.gif width=260><span class=dlink> <a href=http://www.w3.org/TR/REC-CSS2/images/longdesc/inline-layout-desc.html name=img-inline-layout title="Long description for illustration of margin/border
behavior on split inline box">[D]</a></span></div>
<ul>
<li>The margin is inserted before "emphasized" and after "words". </li>
<li>The padding is inserted before, above, and below "emphasized" and after,
above, and below "words". A dashed border is rendered on three sides in each
case. </li>
</ul>
</div>
<h3 class="heading settled heading" data-level=1.3 id=inline1><span class=secno>1.3 </span><span class=content>Block-progression dimensions: the
<a class=property data-link-type=propdesc href=#propdef-text-height title=text-height>text-height</a> property</span><a class=self-link href=#inline1></a></h3>
<p>Each inline box has a block-progression dimension which is derived from the
following parameters: the <a class=property data-link-type=propdesc href=#propdef-text-height title=text-height>text-height</a> and <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#propdef-font-size title=font-size>font-size</a> properties for
non-replaced elements, the height or the width for replaced elements (depending
on the text flow being horizontal or vertical respectively) and the stacked
block-progression dimension for inline-block elements (identical to what is done
for block-level elements).</p>
<p>The block-progression dimension determines the position of the padding,
border and margin for the element but does not necessarily determine the line
stacking progression as this is also affected by the <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a>
property.</p>
<table class=propdef>
<tbody>
<tr>
<td><em>Name:</em></td>
<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-text-height>text-height<a class=self-link href=#propdef-text-height></a></dfn></td>
</tr>
<tr>
<td><em>Value:</em></td>
<td>auto | font-size | text-size | max-size | <number></td>
</tr>
<tr>
<td><em>Initial:</em></td>
<td>auto</td>
</tr>
<tr>
<td><em>Applies to:</em></td>
<td>inline elements and parents of element with display:ruby-text</td>
</tr>
<tr>
<td><em>Inherited:</em></td>
<td>yes</td>
</tr>
<tr>
<td><em>Percentages:</em></td>
<td>N/A</td>
</tr>
<tr>
<td><em>Media:</em></td>
<td>visual</td>
</tr>
<tr>
<td><em>Computed value:</em></td>
<td>specified value (except for initial and inherit)</td>
</tr>
</tbody>
</table>
<p>The <a class=property data-link-type=propdesc href=#propdef-text-height title=text-height>text-height</a> property determine the block-progression dimension of the
text content area of an inline box (non-replaced elements) . Possible values:</p>
<dl>
<dt><strong>auto</strong>
<dd>The block-progression dimension is based either on the em square determined
by the computed element font-size property value or the cell-height (ascender + descender)
related to the computed element font-size as chosen by the user agent.
<dt>font-size</dt>
<dd>The block-progression dimension is based on the em square as determined by
the computed element font-size. </dd>
<dt>text-size</dt>
<dd>The block-progression dimension is based on the cell-height (ascender +
descender) related to the computed element font-size.</dd>
<dt>max-size</dt>
<dd>The block-progression dimension is based on the maximum extents toward the
over-edge and under-edge of the box obtained by considering all children
elements located on the same line, ruby annotations (elements with 'display:ruby-text')
and baseline shifted elements.</dd>
<dt><number></dt>
<dd>The block progression dimension is based on <number> times the em square as
determined by the computed font-size.</dd>
</dl>
<p>When more than one font-size is used (this could happen when glyphs are found
in different fonts), it is recommended that the largest font-size provides the em square and the cell-height.</p>
<p>Although the <a class=property data-link-type=propdesc href=#propdef-text-height title=text-height>text-height</a> property does not apply directly to block
elements, it applies to their anonymous children inline boxes (if any).</p>
<p>For replaced elements, the block-progression dimension is determined by the
outer edges (i.e. margin edge).</p>
<h3 class="heading settled heading" data-level=1.4 id=LineBoxHeight><span class=secno>1.4 </span><span class=content>Block progression positioning and spacing</span><a class=self-link href=#LineBoxHeight></a></h3>
<h4 class="heading settled heading" data-level=1.4.1 id=InlineBoxHeight><span class=secno>1.4.1 </span><span class=content>Line height adjustment: the
<a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> property</span><a class=self-link href=#InlineBoxHeight></a></h4>
<p>The <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> property controls the amount of leading space
which is added over and under an inline box (including the root inline box)
to determine the extended block-progression dimension of the inline box.
The value of the <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a> property determines how the
block-progression dimension and the extended block-progression dimension
affect the height of the line box.
The sum of the possible leading space and the block-progression dimension is called the <dfn data-dfn-type=dfn data-noexport="" id=extended-block-progression-dimension>extended block-progression dimension<a class=self-link href=#extended-block-progression-dimension></a></dfn>.
That extended value is not used for border, margin and padding placement but is used for vertical alignment (relative) and line box block-progression dimension.
</p>
<p>The <span class=index-def title=leading><em>leading</em></span><span title=leading>
for an inline non-replaced element
is defined as the d</span>ifference between the block-progression dimension as
determined by the <a class=property data-link-type=propdesc href=#propdef-text-height title=text-height>text-height</a> property and the computed value
of
<a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a>. Half the leading is
called the <span class=index-def title=half-leading><em>
half-leading</em></span>, each half-leading is
located over and under the element.
The <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> value
will specify the <em>exact</em> extended block-progression dimension of each box
generated by the element.
(Depending on the value of <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a>, the extended block-progression dimension may be ignored.)
(For inline
<a href=http://www.w3.org/TR/REC-CSS2/conform.html#replaced-element>replaced</a>
elements, both the block-progression dimension and the extended
block-progression dimension of the box are given by the
outer edges (i.e. margin edge).)
Anonymous inline boxes use the <a class=property data-link-type=propdesc href=#propdef-text-height title=text-height>text-height</a> and
<a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> property values specified for their parent.</p>
<p>Depending on the
value of the <a class=property data-link-type=propdesc href=#propdef-line-stacking-strategy title=line-stacking-strategy>line-stacking-strategy</a>, the <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> value may provide a
minimum or exact extended block-progression dimension for each generated inline box and
the line boxes. How the leading space is distributed between the over-edge and
the under-edge of inline elements within the line box depends on their
vertical-align property value.
<span class=issue id=issue-9934f9eb><a class=self-link href=#issue-9934f9eb></a>[LDB: I don’t understand this paragraph.]</span>
</p>
<p>Empty inline elements generate empty inline boxes, but these boxes still have
a line height, and thus may influence the line box block-progression dimension,
as if the empty box contained an infinitely narrow letter.</p>
<p>A inline box which otherwise would influence the line box extended
progression dimension may be removed from the computation by using a special
value of the line-height property: <span class=css data-link-type=maybe title=none>none</span>.</p>
<table class=propdef id=name-62>
<tr>
<td><em>Name:</em>
<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-line-height>line-height<a class=self-link href=#propdef-line-height></a></dfn><tr>
<td><em>Value:</em>
<td>normal |
<a class=noxref href=http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-number>
<span class=value-inst-number><number></span></a> |
<a class=noxref href=http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-length>
<span class=value-inst-length><length></span></a> |
<a class=noxref href=http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-percentage>
<span class=value-inst-percentage><percentage></span></a> | none
<tr>
<td><em>Initial:</em>
<td>normal<tr>
<td><em>Applies to:</em>
<td>all elements<tr>
<td><em>Inherited:</em>
<td>yes
<tr>
<td><em>Percentages:</em>
<td>refer to the font size of the element itself <tr>
<td><em>Media:</em>
<td><a class=noxref href=/TR/REC-CSS2/media.html#visual-media-group>visual</a>
<tr>
<td><em>Computed value:</em>
<td>see prose</table>
<p>Values for this property have the following meanings:</p>
<dl>
<dt><strong>normal</strong> </dt>
<dd>Tells user agents to set the
<a href=http://www.w3.org/TR/REC-CSS2/cascade.html#computed-value>computed
value</a> to a "reasonable" value based on the font size of the element. The
value has the same meaning as <span class=index-inst title="<number>">
<a class=noxref href=http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-number name=x18>
<span class=value-inst-number><number></span></a></span>. We recommend a
computed value for <span class=css data-link-type=maybe title=normal>normal</span> between 1.0 to 1.2. The user agent may allow the
<number> to vary depending on the metrics of the font(s) being used.</dd>
<dt><span class=index-inst title="<length>">
<a class=noxref href=http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-length name=x19>
<span class=value-inst-length><strong><length></strong></span></a></span>
</dt>
<dd>The box height is set to this length. Negative values are illegal. The
length is the computed value.</dd>
<dt><span class=index-inst title="<number>">
<a class=noxref href=http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-number name=x20>
<span class=value-inst-number><strong><number></strong></span></a></span>
</dt>
<dd>The <a href=http://www.w3.org/TR/REC-CSS2/cascade.html#computed-value>
computed value</a> of the property is this number multiplied by the element’s
font size. Negative values are illegal. However, the number, not the
<a href=http://www.w3.org/TR/REC-CSS2/cascade.html#computed-value>computed
value</a>, is inherited. </dd>
<dt><span class=index-inst title="<percentage>">
<a class=noxref href=http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-percentage name=x21>
<span class=value-inst-percentage><strong><percentage></strong></span></a></span>
</dt>
<dd>The <a href=http://www.w3.org/TR/REC-CSS2/cascade.html#computed-value>
computed value</a> of the property is this percentage multiplied by the
element’s computed font size. Negative values are illegal.</dd>
<dt>none</dt>
<dd>For inline-level elements, the element does not influence the <a data-link-type=dfn href=#extended-block-progression-dimension title="extended block-progression dimension">extended
block-progression dimension</a> of the line. The computed value is the
specified value (<span class=css data-link-type=maybe title=none>none</span>). For block-level elements, equivalent to <span class=css data-link-type=maybe title=normal>normal</span>
(and the computed value is <span class=css data-link-type=maybe title=normal>normal</span>).
<span class=issue id=issue-5e1feaa0><a class=self-link href=#issue-5e1feaa0></a>This definition should be briefer, and should
refer to the next section.</span></dd>
</dl>
<div class=example>
<p style="DISPLAY: none">Example(s):</p>
<p>The three rules in the example below have the same resultant line height:
</p>
<pre>DIV { line-height: 1.2; font-size: 10pt } /* number */
DIV { line-height: 1.2em; font-size: 10pt } /* length */
DIV { line-height: 120%; font-size: 10pt } /* percentage */
</pre>
</div>
<p>When an element contains text that is rendered in more than one font, user
agents should determine the
<a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> value according to
the largest font size (when appropriate). </p>
<p>Note that replaced elements have a
<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#propdef-font-size title=font-size>font-size</a> and a
<a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> property, even if
they are not used directly to determine the extended block-progression dimension of the box: <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-values-3/#em title=em>em</a> and <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-values-3/#ex title=ex>ex</a>
values are relative to values of <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#propdef-font-size title=font-size>font-size</a> and percentage values for
<a class=property data-link-type=propdesc href=#propdef-vertical-align title=vertical-align>vertical-align</a> are relative
to values of the extended block-progression dimension. <span class=issue id=issue-508c6175><a class=self-link href=#issue-508c6175></a>[LDB: The second part of this sentence is a significant change from CSS2, and also doesn’t mauke senes in the context of the sentence.]</span></p>
<p>When the
<a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> value is less than
the font size, the final inline box extended block-progression dimension will be less than the font size and
the rendered glyphs will "bleed" outside the box. If such a box touches the edge
of a line box, the rendered glyphs will also "bleed" into the adjacent line box.</p>
<h4 class="heading settled heading" data-level=1.4.2 id=LineStacking><span class=secno>1.4.2 </span><span class=content>Line Stacking: the
<a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a> property</span><a class=self-link href=#LineStacking></a></h4>
<table class=propdef id=name-30>
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-line-box-contain>line-box-contain<a class=self-link href=#propdef-line-box-contain></a></dfn><tr>
<td><em>Value:</em>
<td>[ block || inline || font || glyphs || replaced || inline-box ] | none |
inherit | initial
<tr>
<td><em>Initial:</em>
<td>block inline replaced
<tr>
<td><em>Applies to:</em>
<td>block-level elements
<tr>
<td><em>Inherited:</em>
<td>yes
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td>specified value (except for <span class=css data-link-type=maybe title=inherit>inherit</span> and <span class=css data-link-type=maybe title=initial>initial</span>)
</table>
<p>This property enumerates which aspects of the elements in a line box
contribute to the height height of that line box.
<dl>
<dt>block
<dd>The extended block progression dimension of the root inline box
must fit within the line box.
<dt>inline
<dd>The extended block progression dimension of all non-replaced
inline boxes whose <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> is not <span class=css data-link-type=maybe title=none>none</span> in the line box must fit within the line box.
<dt>font
<dd>The block progression dimension of all non-replaced inline boxes in
the line whose <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> is not <span class=css data-link-type=maybe title=none>none</span> that directly (i.e., within
the box but not within one of its descendants) contain non-removed text
must fit within the line box, where non-removed text is any characters
not removed based on the values of the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-text-3/#propdef-white-space title=white-space>white-space</a>. <span class=issue id=issue-4b06b910><a class=self-link href=#issue-4b06b910></a>[LDB: This isn’t quite right. What about zwnj,
etc.?</span>
<dt>glyphs
<dd>The block progression dimension of all the glyph bounding boxes of
glyphs in the line box must fit within the line box.</dd>
<dt>replaced
<dd>The margin box of all <span title="replaced element"><a href=#replaced>replaced elements</a></span> within the line
must fit within the line box.
<dt>inline-box
<dd>The margin-box of all non-replaced inline elements in the line whose
<a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> is not <span class=css data-link-type=maybe title=none>none</span> must fit within the line box. <span class=issue id=issue-42900629><a class=self-link href=#issue-42900629></a>Should this split into inline-border and
inline-margin?</span>
</dl>
<p>If the property has no value for all elements within a line, then the line
box has 0 height, and the line within the anonymous inline established by the
block that coincides with the line block is the baseline of that anonymous
inline block (or should it be determined by the <a class=property data-link-type=propdesc href=#propdef-vertical-align title=vertical-align>vertical-align</a> property of
the block?). <span class=issue id=issue-25a5cd45><a class=self-link href=#issue-25a5cd45></a>[This is arbitrary. Does anyone have better
ideas?]</span>
<p class=note>Note that the CSS2 model is equivalent to 'block inline
replaced' but the backwards-compatible HTML model is similar to (but not
exactly) 'font replaced' [1].
<p class=issue id=issue-f68e4558><a class=self-link href=#issue-f68e4558></a>Concerns: * How does this work with the cascade? * What
about determining the visual size of inline boxes?
<p class=issue id=issue-588d4c54><a class=self-link href=#issue-588d4c54></a>[1] I believe the differences are restricted to the first
line of LI elements, the last line of LI, DD, and DT elements, and issues
concerning whitespace around images. [DB]
<p>The height of each line box is established as follows (we describe the
case for <em><a href=#horizontal>horizontal flow</a></em>, but vertical
flow is analogous). First align all the boxes on the line relative to each
other according to the rules for <a class=property data-link-type=propdesc href=#propdef-vertical-align title=vertical-align>vertical-align</a>. The line box must satisfy all of
the following constraints:
<ol>
<li>For each box on the line that has <span class=css data-link-type=maybe title=font>font</span> in its
value of <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a>, the line box must be
high enough to contain the <span title="top of the text"><a href=#top-of>top and bottom of that box’s text</a></span>.
<li>For each box that has <span class=css data-link-type=maybe title=inline>inline</span> in <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a>, the top of the line
box must be at least as high as the <span title="top of the text"><a href=#top-of>top of the box’s text</a></span> plus the box’s <em><a href=#half-leading>half-leading</a></em>. The bottom of the line box must
be at least as low as the bottom of the text plus the half-leading.
<li>For each box that has <span class=css data-link-type=maybe title=inline-box>inline-box</span> in <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a>,
the top of the line box must be at least as high as the margin-top of this
box. The bottom of the line box must be at least as low as the margin-bottom.
<li>For each <em>replaced box</em> that has <span class=css data-link-type=maybe title=replaced>replaced</span> in its <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a>, the line box must
contain the margin-top and margin-bottom of this box. <span class=issue id=issue-82f9eb8f><a class=self-link href=#issue-82f9eb8f></a>[The value <span class=css data-link-type=maybe title=replaced>replaced</span> is not strictly needed. <span class=css data-link-type=maybe title=Inline-box>Inline-box</span> also
does the job, except that it is not automatically restricted to replaced
elements.]</span>
<li>For each box that has <span class=css data-link-type=maybe title=glyphs>glyphs</span> in <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a>,
the top of the line box must be at least as high as the top of each glyph in
the box (excluding those in child elements). The bottom of the line box must
be at least as low as the bottom of each glyph in the box (excluding child
elements).
<li>If the enclosing block for this line has
<span class=css data-link-type=maybe title=block>block</span> in <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a>, then the top of the line box
must be at least as high as the text top plus the half-leading of an
<em><a href=#anonymous>anonymous inline element</a></em> and the bottom of
the line box as low as the text bottom plus the half leading. This must hold
whether or not this line actually contains such an element.
</ol>
<p class=note>Thus <span class=css data-link-type=maybe title=block>block</span> can be used to set an overall minimum line
height (viz. the value of <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> of the element itself) for all lines
in an element, independent of the actual contents of each line. In
particular, setting <a class=property data-link-type=propdesc href=#propdef-line-box-contain title=line-box-contain>line-box-contain</a> to just <span class=css data-link-type=maybe title=block>block</span> and no other values
will ensure that all lines are the same height, at the possible risk of some
tall inline elements overlapping with lines above or below.
<p>The <dfn data-dfn-type=dfn data-noexport="" id=half-leading>half-leading<a class=self-link href=#half-leading></a></dfn> of a box is defined as half
the computed value of <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> minus half the computed value of
<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#propdef-font-size title=font-size>font-size</a>, i.e., (line-height - font-size)/2.
<p>The <dfn data-dfn-type=dfn data-noexport="" id=top-of>top of the text<a class=self-link href=#top-of></a></dfn> is the top of the em-box of a
box’s nominal font, whether or not there actually is any letter that tall.
Replaced elements, for example, have no text, but still have a nominal font
and are thus a text top. The rules above refer to the position of the text
top after the box has been aligned with <a class=property data-link-type=propdesc href=#propdef-vertical-align title=vertical-align>vertical-align</a>.
<h5 class="heading settled heading" data-level=1.4.2.1 id=old-remove-this><span class=secno>1.4.2.1 </span><span class=content>Old, remove this:</span><a class=self-link href=#old-remove-this></a></h5>
<p>Line stacking is the mechanism by which a line box is determined for each
line in a block and then these lines are stacked in the block-progression
direction resolving any spacing constraints between adjacent lines. The
line-stacking strategy covers both the determination of the block-progression
dimension (height in horizontal flow) of a line box and the rules for spacing
line boxes.</p>
<p>All line stacking strategies make use of the properties: <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#propdef-font-size title=font-size>font-size</a>,
<a class=property data-link-type=propdesc href=#propdef-text-height title=text-height>text-height</a> and <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a>.</p>
<p>The line stacking properties are made of the following properties:</p>
<ol>
<li>The <a class=property data-link-type=propdesc href=#propdef-line-stacking-strategy title=line-stacking-strategy>line-stacking-strategy</a> property determines the overall stacking
method,</li>
<li>The <a class=property data-link-type=propdesc href=#propdef-line-stacking-ruby title=line-stacking-ruby>line-stacking-ruby</a> property determines how elements with
'display=ruby' are stacked,</li>
<li>The <a class=property data-link-type=propdesc href=#propdef-line-stacking-shift title=line-stacking-shift>line-stacking-shift</a> property determines how elements which are
baseline-shifted are stacked,</li>
<li>Finally the <a class=property data-link-type=propdesc href=#propdef-line-stacking title=line-stacking>line-stacking</a> property is a short-hand for the previous
properties.</li>
</ol>
<table class=propdef id=name-162>
<tr>
<td><em>Name:</em>
<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-line-stacking-strategy>line-stacking-strategy<a class=self-link href=#propdef-line-stacking-strategy></a></dfn><tr>
<td><em>Value:</em>
<td>inline-line-height | block-line-height | max-height | grid-height
<tr>
<td><em>Initial:</em>
<td>inline-line-height<tr>
<td><em>Applies to:</em>
<td>block-level elements
<tr>
<td><em>Inherited:</em>
<td>yes
<tr>
<td><em>Percentages:</em>
<td>N/A<tr>
<td><em>Media:</em>
<td><a class=noxref href=/TR/REC-CSS2/media.html#visual-media-group>visual</a>
<tr>
<td><em>Computed value:</em>
<td>specified value (except for initial and inherit)</table>
<p>This property determines the line stacking strategy for stacked line boxes
within a containing block element. The term <dfn data-dfn-type=dfn data-noexport="" id=stack-height>stack-height<a class=self-link href=#stack-height></a></dfn> is used in the
context of this property description to indicate the block-progression dimension
for the line boxes. Possible values:
<dl>
<dt><strong>inline-line-height</strong>
<dd>The <a data-link-type=dfn href=#stack-height title=stack-height>stack-height</a> is the smallest value that contains the <a data-link-type=dfn href=#extended-block-progression-dimension title="extended block-progression dimension">extended
block-progression dimension</a> of all the inline elements on that line when those
elements are properly aligned. Since the line spacing information is already
included in the computation of the line box, these line boxes are simply stacked
adjacent to one another in the formatted block to which they belong. The
<a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> property value is taken into account for both the inline elements
and the block elements. For inline elements, it defines the extended
block-progression dimension. For block elements, it defines the
<a data-link-type=dfn href=#minimum-extended-block-progression-dimension title="minimum extended block-progression dimension">minimum extended block-progression dimension</a>.
<dt>block-line-height</dt>
<dd>The <a data-link-type=dfn href=#stack-height title=stack-height>stack-height</a> is determined by the block element computed <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> property
value. The <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> property value is ignored for inline elements. For
alignment purpose, this case is similar to the
<a data-link-type=dfn href=#minimum-extended-block-progression-dimension title="minimum extended block-progression dimension">minimum extended block-progression dimension</a> case (strut model).
This is the only line-stacking strategy that may cause inline boxes within the line
to bleed over and under the line box because the line box is not constrained by its inline boxes.
If the block computed <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> is <span class=css data-link-type=maybe title=none>none</span>, the stack-height is determined as if
'line-height: normal'.</dd>
<dt>max-height</dt>
<dd>The <a data-link-type=dfn href=#stack-height title=stack-height>stack-height</a> is the smallest value that contains the
block-progression dimension of all the inline elements on that line when those
elements are properly aligned. The <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> property value is taken into
account only for the block elements and it defines the
<dfn data-dfn-type=dfn data-noexport="" id=minimum-extended-block-progression-dimension>minimum extended block-progression dimension<a class=self-link href=#minimum-extended-block-progression-dimension></a></dfn>.</dd>
<dt>grid-height</dt>
<dd>The <a data-link-type=dfn href=#stack-height title=stack-height>stack-height</a> is the smallest multiple of the block element <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a>
computed value that can contain the block-progression of all the inline
elements on that line when those elements are properly aligned. The
<a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> property value is ignored for inline elements. If the block
computed <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> is <span class=css data-link-type=maybe title=none>none</span>, the stack-height is determined as if
'line-height: normal'.</dd>
</dl>
<p>When the line-stack strategy dictates that the inline element line-height be
ignored, this means that for those elements only their block-progression
dimensions are considered for the <a data-link-type=dfn href=#stack-height title=stack-height>stack-height</a>, not their extended
block-progression dimensions.</p>
<p class=note><b>Note.</b> XSL has a similar property with the same name which
use different but equivalent values: <a class=property data-link-type=propdesc href=#propdef-line-height title=line-height>line-height</a> instead of
<span class=css data-link-type=maybe title=inline-line-height>inline-line-height</span>, <span class=css data-link-type=maybe title=font-height>font-height</span> instead of <span class=css data-link-type=maybe title=block-line-height>block-line-height</span>. It also uses
<span class=css data-link-type=maybe title=max-height>max-height</span>. The value <span class=css data-link-type=maybe title=grid-height>grid-height</span> is new to the CSS3 property.<p> <table class=propdef id=name-60>
<tr>
<td><em>Name:</em>
<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-line-stacking-ruby>line-stacking-ruby<a class=self-link href=#propdef-line-stacking-ruby></a></dfn><tr>
<td><em>Value:</em>
<td>exclude-ruby | include-ruby
<tr>
<td><em>Initial:</em>
<td>exclude-ruby<tr>
<td><em>Applies to:</em>
<td>block-level elements
<tr>
<td><em>Inherited:</em>
<td>yes
<tr>
<td><em>Percentages:</em>
<td>N/A<tr>
<td><em>Media:</em>
<td><a class=noxref href=/TR/REC-CSS2/media.html#visual-media-group>visual</a>
<tr>
<td><em>Computed value:</em>
<td>specified value (except for initial and inherit)</table>
<p>This property determines the line stacking method for block elements
containing ruby annotation elements (element with 'display: ruby-text' or
'display: ruby-text-container'). In all cases the ruby base elements (elements
with 'display: ruby-base' or display: ruby-base-container') are considered for
line stacking. Possible values:<dl>
<dt><strong>exclude-ruby</strong>
<dd>The ruby annotation elements are ignored for line stacking.<dt>include-ruby</dt>
<dd>The ruby annotation elements are considered for line stacking.</dd>
</dl>
<p>This property is ignored in two cases:<ol>
<li>The element text-height property is set to <span class=css data-link-type=maybe title=max-size>max-size</span>.</li>
<li>The line stacking strategy is set to <span class=css data-link-type=maybe title=block-line-height>block-line-height</span>.</li>
</ol>
<table class=propdef id=name-160>
<tr>
<td><em>Name:</em>
<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-line-stacking-shift>line-stacking-shift<a class=self-link href=#propdef-line-stacking-shift></a></dfn><tr>
<td><em>Value:</em>
<td>consider-shifts | disregard-shifts<tr>
<td><em>Initial:</em>
<td>consider-shifts<tr>
<td><em>Applies to:</em>
<td>block-level elements
<tr>
<td><em>Inherited:</em>
<td>yes
<tr>
<td><em>Percentages:</em>
<td>N/A<tr>
<td><em>Media:</em>
<td><a class=noxref href=/TR/REC-CSS2/media.html#visual-media-group>visual</a>
<tr>
<td><em>Computed value:</em>
<td>specified value (except for initial and inherit)</table>
<p>This property determines the line stacking method for block elements
containing elements with baseline-shift. Possible values:<dl>
<dt><strong>consider-shifts</strong>
<dd>In determining the <a data-link-type=dfn href=#stack-height title=stack-height>stack-height</a>, include the adjusted top-edge and
bottom-edge of any characters that have a baseline-shift.
<dt>disregard-shifts</dt>
<dd>In determining the <a data-link-type=dfn href=#stack-height title=stack-height>stack-height</a>, include the unshifted top-edge and
bottom-edge of any characters that have a baseline-shift. </dd>
</dl>
<p>This property is ignored in two cases:<ol>
<li>The element text-height property is set to <span class=css data-link-type=maybe title=max-size>max-size</span>.</li>
<li>The line stacking strategy is set to <span class=css data-link-type=maybe title=block-line-height>block-line-height</span>.</li>
</ol>
<p class=note><b>Note.</b> XSL has a similar property with a different name:
<a class=property data-link-type=propdesc title=line-height-shift-adjustment>line-height-shift-adjustment</a> which use the same values.<p>Finally, the line
stacking strategy can be used using the following shorthand:</p>
<table class=propdef id=name-260>
<tr>
<td><em>Name:</em>
<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-line-stacking>line-stacking<a class=self-link href=#propdef-line-stacking></a></dfn><tr>
<td><em>Value:</em>
<td><<a class=property data-link-type=propdesc href=#propdef-line-stacking-strategy title=line-stacking-strategy>line-stacking-strategy</a>> || <<a class=property data-link-type=propdesc href=#propdef-line-stacking-ruby title=line-stacking-ruby>line-stacking-ruby</a>> ||
<<a class=property data-link-type=propdesc href=#propdef-line-stacking-shift title=line-stacking-shift>line-stacking-shift</a>><tr>
<td><em>Initial:</em>
<td>see individual properties<tr>
<td><em>Applies to:</em>
<td>block-level elements
<tr>
<td><em>Inherited:</em>
<td>yes
<tr>
<td><em>Percentages:</em>
<td>N/A<tr>
<td><em>Media:</em>
<td><a class=noxref href=/TR/REC-CSS2/media.html#visual-media-group>visual</a>
<tr>
<td><em>Computed value:</em>
<td>see individual properties</table>
<h2 class="heading settled heading" data-level=2 id=baseline><span class=secno>2 </span><span class=content>Baseline alignment</span><a class=self-link href=#baseline></a></h2>
<p>Baseline alignment describes the alignment of textual content and based on
information contained in font tables associated with font resources.
Additional descriptions for these font tables are provided in thea href="http://www.w3.org/Style/Group/css3-src/css3-fonts/Overview.html">CSS3