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
3057 lines (3046 loc) · 248 KB
/
Overview.html
File metadata and controls
3057 lines (3046 loc) · 248 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 Writing Modes Level 3</title>
<meta content="testing" name="csswg-work-status">
<meta content="CR" name="w3c-status">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<link href="https://www.w3.org/StyleSheets/TR/W3C-CR" rel="stylesheet" type="text/css">
<meta content="Bikeshed 1.0.0" name="generator">
<script defer="" src="//test.csswg.org/harness/annotate.js#css-writing-modes-3_dev/css-writing-modes-3" type="text/javascript"></script>
<style>
object { vertical-align: middle; }
.sidebar { float: right; background: #eee; border: solid gray; margin: 1em; }
.sidebar .figure { margin: 1em; }
.sidebar object { margin: 0 auto; display: block; }
.figurepair { display: table; margin: 1em auto; }
.figurepair .figure { display: table-cell; padding-left: .5em; padding-right: .5em; }
h2, .example { clear: both; }
.figure img,
.figure object,
.example img,
dd img { max-width: 100%; display: block; margin: 1em auto; }
div.figure table {
margin:auto;
}
.ascii-art {
display: table;
margin: 1em auto;
}
</style>
<style>.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #708090 } /* Comment */
.highlight .k { color: #990055 } /* Keyword */
.highlight .l { color: #669900 } /* Literal */
.highlight .n { color: #0077aa } /* Name */
.highlight .o { color: #999999 } /* Operator */
.highlight .p { color: #999999 } /* Punctuation */
.highlight .cm { color: #708090 } /* Comment.Multiline */
.highlight .cp { color: #708090 } /* Comment.Preproc */
.highlight .c1 { color: #708090 } /* Comment.Single */
.highlight .cs { color: #708090 } /* Comment.Special */
.highlight .kc { color: #990055 } /* Keyword.Constant */
.highlight .kd { color: #990055 } /* Keyword.Declaration */
.highlight .kn { color: #990055 } /* Keyword.Namespace */
.highlight .kp { color: #990055 } /* Keyword.Pseudo */
.highlight .kr { color: #990055 } /* Keyword.Reserved */
.highlight .kt { color: #990055 } /* Keyword.Type */
.highlight .ld { color: #669900 } /* Literal.Date */
.highlight .m { color: #990055 } /* Literal.Number */
.highlight .s { color: #669900 } /* Literal.String */
.highlight .na { color: #0077aa } /* Name.Attribute */
.highlight .nc { color: #0077aa } /* Name.Class */
.highlight .no { color: #0077aa } /* Name.Constant */
.highlight .nd { color: #0077aa } /* Name.Decorator */
.highlight .ni { color: #0077aa } /* Name.Entity */
.highlight .ne { color: #0077aa } /* Name.Exception */
.highlight .nf { color: #0077aa } /* Name.Function */
.highlight .nl { color: #0077aa } /* Name.Label */
.highlight .nn { color: #0077aa } /* Name.Namespace */
.highlight .py { color: #0077aa } /* Name.Property */
.highlight .nt { color: #0077aa } /* Name.Tag */
.highlight .nv { color: #0077aa } /* Name.Variable */
.highlight .ow { color: #999999 } /* Operator.Word */
.highlight .mb { color: #990055 } /* Literal.Number.Bin */
.highlight .mf { color: #990055 } /* Literal.Number.Float */
.highlight .mh { color: #990055 } /* Literal.Number.Hex */
.highlight .mi { color: #990055 } /* Literal.Number.Integer */
.highlight .mo { color: #990055 } /* Literal.Number.Oct */
.highlight .sb { color: #669900 } /* Literal.String.Backtick */
.highlight .sc { color: #669900 } /* Literal.String.Char */
.highlight .sd { color: #669900 } /* Literal.String.Doc */
.highlight .s2 { color: #669900 } /* Literal.String.Double */
.highlight .se { color: #669900 } /* Literal.String.Escape */
.highlight .sh { color: #669900 } /* Literal.String.Heredoc */
.highlight .si { color: #669900 } /* Literal.String.Interpol */
.highlight .sx { color: #669900 } /* Literal.String.Other */
.highlight .sr { color: #669900 } /* Literal.String.Regex */
.highlight .s1 { color: #669900 } /* Literal.String.Single */
.highlight .ss { color: #669900 } /* Literal.String.Symbol */
.highlight .vc { color: #0077aa } /* Name.Variable.Class */
.highlight .vg { color: #0077aa } /* Name.Variable.Global */
.highlight .vi { color: #0077aa } /* Name.Variable.Instance */
.highlight .il { color: #990055 } /* Literal.Number.Integer.Long */
.highlight { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
</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 Writing Modes Level 3</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">W3C Candidate Recommendation, <time class="dt-updated" datetime="2015-12-15">15 December 2015</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="http://www.w3.org/TR/2015/CR-css-writing-modes-3-20151215/">http://www.w3.org/TR/2015/CR-css-writing-modes-3-20151215/</a>
<dt>Latest version:
<dd><a href="http://www.w3.org/TR/css-writing-modes-3/">http://www.w3.org/TR/css-writing-modes-3/</a>
<dt>Editor's Draft:
<dd><a href="http://dev.w3.org/csswg/css-writing-modes-3/">http://dev.w3.org/csswg/css-writing-modes-3/</a>
<dt>Previous Versions:
<dd><a href="http://www.w3.org/TR/2014/CR-css-writing-modes-3-20140320/" rel="previous">http://www.w3.org/TR/2014/CR-css-writing-modes-3-20140320/</a>
<dt>Feedback:
<dd><span><a href="mailto:www-style@w3.org?subject=%5Bcss-writing-modes%5D%20YOUR%20TOPIC%20HERE">www-style@w3.org</a> with subject line “<kbd>[css-writing-modes] <i data-lt="… message topic …">… message topic …</i></kbd>” (<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</span>
<dt>Test Suite:
<dd><a href="http://test.csswg.org/suites/css-writing-modes-3_dev/nightly-unstable/">http://test.csswg.org/suites/css-writing-modes-3_dev/nightly-unstable/</a>
<dt>Issue Tracking:
<dd>&l
8096
t;a href="#issues-index">Inline In Spec</a>
<dd><span><a href="http://www.w3.org/Style/CSS/Tracker/products/30">http://www.w3.org/Style/CSS/Tracker/products/30</a></span>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="http://fantasai.inkedblade.net/contact">Elika J. Etemad / fantasai</a> (<span class="p-org org">Invited Expert</span>)
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:kojiishi@gmail.com">Koji Ishii</a> (<span class="p-org org">Google</span>)
<dt>Former Editors:
<dd>
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:murakami@antenna.co.jp">Shinyu Murakami</a> (<span class="p-org org">Antenna House</span>)
<dd>
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:paulnel@microsoft.com">Paul Nelson</a> (<span class="p-org org">Microsoft</span>)
<dd>
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:michelsu@microsoft.com">Michel Suignard</a> (<span class="p-org org">Microsoft</span>)
</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> © 2015 <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>). 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" id="abstract"><span class="content">Abstract</span></h2>
<div class="p-summary" data-fill-with="abstract">
<p>CSS Writing Modes Level 3 defines CSS support for various international writing modes, such as left-to-right (e.g. Latin or Indic), right-to-left (e.g. Hebrew or Arabic), bidirectional (e.g. mixed Latin and Arabic) and vertical (e.g. Asian scripts).</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" id="status"><span class="content">Status of this document</span></h2>
<div data-fill-with="status">
<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>
<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>)
as a Candidate Recommendation. This document is intended to become a W3C Recommendation.
This document will remain a Candidate Recommendation at least until <time class="status-deadline" datetime="2016-03-15">15 March 2016</time> in order
to ensure the opportunity for wide review. </p>
<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-writing-modes%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-writing-modes” in the subject,
preferably like this:
“[css-writing-modes] <em>…summary of comment…</em>” </p>
<p> Publication as a Candidate Recommendation 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>
<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> This document is governed by the <a href="http://www.w3.org/2015/Process-20150901/" id="w3c_process_revision">1 September 2015 W3C Process Document</a>. </p>
<p> For changes since the last draft,
see the <a href="#changes">Changes</a> section. </p>
<p></p>
</div>
<div data-fill-with="at-risk">
<p>The following features are at-risk, and may be dropped during the CR period: </p>
<ul>
<li>The <a class="css" data-link-type="maybe" href="#valdef-writing-mode-sideways-lr">sideways-lr</a> and <a class="css" data-link-type="maybe" href="#valdef-writing-mode-sideways-rl">sideways-rl</a> of <a class="property" data-link-type="propdesc" href="#propdef-writing-mode">writing-mode</a>
<li>The <span class="css">digits</span> value of <a class="property" data-link-type="propdesc" href="#propdef-text-combine-upright">text-combine-upright</a>.
<li>The look-ahead/look-behind sequencing rules for <a class="property" data-link-type="propdesc" href="#propdef-text-combine-upright">text-combine-upright</a>.
<li><a href="#auto-multicol">Automatic multi-column behavior</a> of orthogonal flows.
</ul>
<p>“At-risk” is a W3C Process term-of-art, and does not necessarily imply that the feature is in danger of being dropped or delayed. It means that the WG believes the feature may have difficulting being interoperably implemented in a timely manner, and marking it as such allows the WG to drop the feature if necessary when transitioning to the Proposed Rec stage, without having to publish a new Candidate Rec without the feature first.</p>
</div>
<h2 class="no-num no-toc no-ref heading settled" id="contents"><span class="content">Table of Contents</span></h2>
<div data-fill-with="table-of-contents" role="navigation">
<ul class="toc" role="directory">
<li>
<a href="#text-flow"><span class="secno">1</span> <span class="content"> Introduction to Writing Modes</span></a>
<ul class="toc">
<li><a href="#placement"><span class="secno">1.1</span> <span class="content"> Module Interactions</span></a>
<li><a href="#values"><span class="secno">1.2</span> <span class="content"> Value Types and Terminology</span></a>
</ul>
<li>
<a href="#text-direction"><span class="secno">2</span> <span class="content"> Inline Direction and Bidirectionality</span></a>
<ul class="toc">
<li><a href="#direction"><span class="secno">2.1</span> <span class="content"> Specifying Directionality: the <span class="property">direction</span> property</span></a>
<li><a href="#unicode-bidi"><span class="secno">2.2</span> <span class="content"> Embeddings and Overrides: the <span class="property">unicode-bidi</span> property</span></a>
<li><a href="#bidi-example"><span class="secno">2.3</span> <span class="content"> Example of Bidirectional Text</span></a>
<li>
<a href="#bidi-algo"><span class="secno">2.4</span> <span class="content"> Applying the Bidirectional Reordering Algorithm</span></a>
<ul class="toc">
<li><a href="#bidi-para-direction"><span class="secno">2.4.1</span> <span class="content"> Bidi Paragraph Embedding Levels</span></a>
<li><a href="#bidi-control-codes"><span class="secno">2.4.2</span> <span class="content"> CSS–Unicode Bidi Control Translation, Text Reordering</span></a>
<li><a href="#bidi-atomic-inlines"><span class="secno">2.4.3</span> <span class="content"> Bidi Treatment of Atomic Inlines</span></a>
<li><a href="#bidi-embedding-breaks"><span class="secno">2.4.4</span> <span class="content"> Paragraph Breaks Within Embeddings and Isolates</span></a>
<li><a href="#bidi-box-model"><span class="secno">2.4.5</span> <span class="content"> Reordering-induced Box Fragmentation</span></a>
</ul>
</ul>
<li>
<a href="#vertical-intro"><span class="secno">3</span> <span class="content"> Introduction to Vertical Text</span></a>
<ul class="toc">
<li>
<a href="#block-flow"><span class="secno">3.1</span> <span class="content"> Block Flow Direction: the <span class="property">writing-mode</span> property</span></a>
<ul class="toc">
<li><a href="#svg-writing-mode"><span class="secno">3.1.1</span> <span class="content"> Obsolete SVG1.1 <span class="property">writing-mode</span> Values</span></a>
</ul>
</ul>
<li>
<a href="#inline-alignment"><span class="secno">4</span> <span class="content"> Inline-level Alignment</span></a>
<ul class="toc">
<li><a href="#intro-baselines"><span class="secno">4.1</span> <span class="content"> Introduction to Baselines</span></a>
<li><a href="#text-baselines"><span class="secno">4.2</span> <span class="content"> Text Baselines</span></a>
<li><a href="#replaced-baselines"><span class="secno">4.3</span> <span class="content"> Atomic Inline Baselines</span></a>
<li><a href="#baseline-alignment"><span class="secno">4.4</span> <span class="content"> Baseline Alignment</span></a>
</ul>
<li>
<a href="#intro-text-layout"><span class="secno">5</span> <span class="content"> Introduction to Vertical Text Layout</span></a>
<ul class="toc">
<li>
<a href="#text-orientation"><span class="secno">5.1</span> <span class="content"> Orienting Text: the <span class="property">text-orientation</span> property</span></a>
<ul class="toc">
<li><a href="#vertical-font-features"><span class="secno">5.1.1</span> <span class="content"> Vertical Typesetting and Font Features</span></a>
<li><a href="#vertical-orientations"><span class="secno">5.1.2</span> <span class="content"> Mixed Vertical Orientations</span></a>
<li><a href="#glyph-orientation"><span class="secno">5.1.3</span> <span class="content"> Obsolete: the SVG1.1 <span class="property">glyph-orientation-vertical</span> property</span></a>
</ul>
</ul>
<li>
<a href="#abstract-box"><span class="secno">6</span> <span class="content"> Abstract Box Terminology</span></a>
<ul class="toc">
<li><a href="#abstract-axes"><span class="secno">6.1</span> <span class="content"> Abstract Dimensions</span></a>
<li><a href="#logical-directions"><span class="secno">6.2</span> <span class="content"> Flow-relative Directions</span></a>
<li><a href="#line-directions"><span class="secno">6.3</span> <span class="content"> Line-relative Directions</span></a>
<li><a href="#logical-to-physical"><span class="secno">6.4</span> <span class="content"> Abstract-to-Physical Mappings</span></a>
</ul>
<li>
<a href="#abstract-layout"><span class="secno">7</span> <span class="content"> Abstract Box Layout</span></a>
<ul class="toc">
<li><a href="#vertical-layout"><span class="secno">7.1</span> <span class="content"> Principles of Layout in Vertical Writing Modes</span></a>
<li><a href="#dimension-mapping"><span class="secno">7.2</span> <span class="content"> Dimensional Mapping</span></a>
<li>
<a href="#orthogonal-flows"><span class="secno">7.3</span> <span class="content"> Orthogonal Flows</span></a>
<ul class="toc">
<li><a href="#orthogonal-auto"><span class="secno">7.3.1</span> <span class="content"> Available Sizes in Orthogonal Flows</span></a>
<li><a href="#auto-multicol"><span class="secno">7.3.2</span> <span class="content"> Auto-sizing Block Containers in Orthogonal Flows</span></a>
<li><a href="#orthogonal-layout"><span class="secno">7.3.3</span> <span class="content"> Auto-sizing Other Orthogonal Flow Roots</span></a>
<li><a href="#orthogonal-pagination"><span class="secno">7.3.4</span> <span class="content"> Fragmenting Orthogonal Flows</span></a>
</ul>
<li><a href="#logical-direction-layout"><span class="secno">7.4</span> <span class="content"> Flow-Relative Mappings</span></a>
<li><a href="#line-mappings"><span class="secno">7.5</span> <span class="content"> Line-Relative Mappings</span></a>
<li><a href="#physical-only"><span class="secno">7.6</span> <span class="content"> Purely Physical Mappings</span></a>
</ul>
<li>
<a href="#principal-flow"><span class="secno">8</span> <span class="content"> The Principal Writing Mode</span></a>
<ul class="toc">
<li><a href="#icb"><span class="secno">8.1</span> <span class="content"> Propagation to the Initial Containing Block</span></a>
<li><a href="#page-direction"><span class="secno">8.2</span> <span class="content"> Page Flow: the page progression direction</span></a>
</ul>
<li>
<a href="#text-combine"><span class="secno">9</span> <span class="content"> Glyph Composition</span></a>
<ul class="toc">
<li>
<a href="#text-combine-upright"><span class="secno">9.1</span> <span class="content"> Horizontal-in-Vertical Composition: the <span class="property">text-combine-upright</span> property</span></a>
<ul class="toc">
<li><a href="#text-combine-runs"><span class="secno">9.1.1</span> <span class="content"> Text Run Rules</span></a>
<li><a href="#text-combine-layout"><span class="secno">9.1.2</span> <span class="content"> Layout Rules</span></a>
<li>
<a href="#text-combine-compression"><span class="secno">9.1.3</span> <span class="content"> Compression Rules</span></a>
<ul class="toc">
<li><a href="#text-combine-fullwidth"><span class="secno">9.1.3.1</span> <span class="content"> Full-width Characters</span></a>
</ul>
</ul>
</ul>
<li>
<a href="#changes"><span class="secno"></span> <span class="content">Changes</span></a>
<ul class="toc">
<li><a href="#changes-201311"><span class="secno"></span> <span class="content"> Changes since the <span>March
2014 CSS Writing Modes Module Level 3 Candidate Recommendation</span></span></a>
</ul>
<li><a href="#acknowledgements"><span class="secno"></span> <span class="content"> Acknowledgements</span></a>
<li><a href="#script-orientations"><span class="secno"></span> <span class="content">Appendix A:
Vertical Scripts in Unicode</span></a>
<li>
<a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
<ul class="toc">
<li><a href="#conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
<li><a href="#conformance-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
<li><a href="#partial"><span class="secno"></span> <span class="content"> Partial implementations</span></a>
<li><a href="#experimental"><span class="secno"></span> <span class="content"> Experimental implementations</span></a>
<li><a href="#testing"><span class="secno"></span> <span class="content"> Non-experimental implementations</span></a>
<li><a href="#cr-exit-criteria"><span class="secno"></span> <span class="content"> CR exit criteria</span></a>
</ul>
<li>
<a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ul class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ul>
<li>
<a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ul class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
</ul>
<li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
<li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ul>
</div>
<main>
<h2 class="heading settled" data-level="1" id="text-flow"><span class="secno">1. </span><span class="content"> Introduction to Writing Modes</span><a class="self-link" href="#text-flow"></a></h2>
<p>CSS Writing Modes Level 3 defines CSS features to support for various international
writing modes, such as left-to-right (e.g. Latin or Indic), right-to-left
(e.g. Hebrew or Arabic), bidirectional (e.g. mixed Latin and Arabic) and
vertical (e.g. Asian scripts).</p>
<p>A <dfn data-dfn-type="dfn" data-export="" id="writing-mode">writing mode<a class="self-link" href="#writing-mode"></a></dfn> in CSS is determined by the <a class="property" data-link-type="propdesc" href="#propdef-writing-mode">writing-mode</a>, <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a>, and <a class="property" data-link-type="propdesc" href="#propdef-text-orientation">text-orientation</a> properties. It is defined primarily
in terms of its <a data-link-type="dfn" href="#inline-base-direction">inline base direction</a> and <a data-link-type="dfn" href="#block-flow-direction">block flow direction</a>: </p>
<div class="sidebar">
<div class="figure right">
<a href="diagrams/text-flow-vectors-tb.svg"> <img alt="Latin-based writing mode" class="landscape" src="diagrams/text-flow-vectors-tb.png"></a>
<p class="caption">Latin-based writing mode </p>
</div>
<div class="figure left">
<a href="diagrams/text-flow-vectors-lr-reverse.svg"> <img alt="Mongolian-based writing mode" class="landscape" src="diagrams/text-flow-vectors-lr-reverse.png"></a>
<p class="caption">Mongolian-based writing mode </p>
</div>
<div class="figure right">
<a href="diagrams/text-flow-vectors-tb.svg"> <img alt="Han-based writing mode" class="landscape" src="diagrams/text-flow-vectors-tb.png"></a> <a href="diagrams/text-flow-vectors-rl.svg"> <img alt="Han-based writing mode" class="landscape" src="diagrams/text-flow-vectors-rl.png"></a>
<p class="caption">Han-based writing mode </p>
</div>
</div>
<p>The <dfn data-dfn-type="dfn" data-export="" id="inline-base-direction">inline base direction<a class="self-link" href="#inline-base-direction"></a></dfn> is the primary direction in which
content is ordered on a line and defines on which sides the “start”
and “end” of a line are. The <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property specifies the
inline base direction of a box and, together with the <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> property and the inherent directionality of any text content, determines
the ordering of inline-level content within a line. </p>
<p>The <dfn data-dfn-type="dfn" data-export="" id="block-flow-direction">block flow direction<a class="self-link" href="#block-flow-direction"></a></dfn> is the direction in which
block-level boxes stack and the direction in which line boxes stack
within a block container. The <a class="property" data-link-type="propdesc" href="#propdef-writing-mode">writing-mode</a> property determines the
block flow direction.</p>
<p>The <dfn data-dfn-type="dfn" data-export="" id="typographic-mode">typographic mode<a class="self-link" href="#typographic-mode"></a></dfn> determines if text should apply
typographic conventions specific to vertical flow for <a data-link-type="dfn" href="#vertical-script">vertical
scripts</a>.
This concept distinguishes vertical flow for <a data-link-type="dfn" href="#vertical-script">vertical scripts</a> from
rotated horizontal flow. </p>
<p>A <dfn data-dfn-type="dfn" data-export="" id="horizontal-writing-mode">horizontal writing mode<a class="self-link" href="#horizontal-writing-mode"></a></dfn> is one with horizontal lines of
text, i.e. a downward or upward block flow.
A <dfn data-dfn-type="dfn" data-export="" id="vertical-writing-mode">vertical writing mode<a class="self-link" href="#vertical-writing-mode"></a></dfn> is one with vertical lines of text,
i.e. a leftward or rightward block flow. </p>
<p class="note" role="note">These terms should not be confused with <dfn data-dfn-type="dfn" data-noexport="" id="vertical-block-flow">vertical block flow<a class="self-link" href="#vertical-block-flow"></a></dfn> (which is a downward or
upward block flow) and <dfn data-dfn-type="dfn" data-noexport="" id="horizontal-block-flow">horizontal block flow<a class="self-link" href="#horizontal-block-flow"></a></dfn> (which is
leftward or rightward block flow). To avoid confusion, CSS
specifications avoid this latter set of terms.</p>
<p>Writing systems typically have one or two native writing modes. Some
examples are: </p>
<ul>
<li>Latin-based systems are typically written using a left-to-right inline
direction with a downward (top-to-bottom) block flow direction.
<li>Arabic-based systems are typically written using a right-to-left
inline direction with a downward (top-to-bottom) block flow direction.
<li>Mongolian-based systems are typically written using a top-to-bottom
inline direction with a rightward (left-to-right) block flow direction.
<li>Han-based systems are commonly written using a left-to-right inline direction
with a downward (top-to-bottom) block flow direction, <strong>or</strong> a top-to-bottom inline direction with a leftward (right-to-left) block
flow direction. Many magazines and newspapers will mix these two writing
modes on the same page.
</ul>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-text-orientation">text-orientation</a> component of the writing mode
controls the <i data-lt="glyph orientation">glyph orientation</i>. </p>
<p class="note" role="note">See Unicode Technical Note #22 <a data-link-type="biblio" href="#biblio-utn22">[UTN22]</a> (<a href="http://fantasai.inkedblade.net/style/discuss/vertical-text/paper">HTML version</a>)
for a more in-depth introduction to writing modes and vertical text. </p>
<h3 class="heading settled" data-level="1.1" id="placement"><span class="secno">1.1. </span><span class="content"> Module Interactions</span><a class="self-link" href="#placement"></a></h3>
<p>This module replaces and extends the <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> and <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> features defined in <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> sections 8.6 and 9.10. </p>
<h3 class="heading settled" data-level="1.2" id="values"><span class="secno">1.2. </span><span class="content"> Value Types and Terminology</span><a class="self-link" href="#values"></a></h3>
<p>This specification follows the <a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
definition conventions</a> from <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. Value types not defined in
this specification are defined in CSS Level 2 Revision 1 <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>.
Other CSS modules may expand the definitions of these value types: for
example <a data-link-type="biblio" href="#biblio-css3color">[CSS3COLOR]</a>, 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. </p>
<p>Other important terminology and concepts used in this specification
are defined in <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> and <a data-link-type="biblio" href="#biblio-css3-text">[CSS3-TEXT]</a>. </p>
<p><span id="bidi"></span></p>
<h2 class="heading settled" data-level="2" id="text-direction"><span class="secno">2. </span><span class="content"> Inline Direction and Bidirectionality</span><a class="self-link" href="#text-direction"></a></h2>
<p>While the characters in most scripts are written from left to right,
certain scripts are written from right to left. In some documents,
in particular those written with the Arabic or Hebrew script, and in
some mixed-language contexts, text in a single (visually displayed)
block may appear with mixed directionality. This phenomenon is called <dfn data-dfn-type="dfn" data-export="" id="bidirectionality">bidirectionality<a class="self-link" href="#bidirectionality"></a></dfn>, or "bidi" for short.</p>
<div class="figure">
<p><img alt="An example of bidirectional text is a Latin name in an Arabic
sentence. The sentence overall is typeset right-to-left, but
the letters in the Latin word in the middle are typeset
left-to-right." src="diagrams/bidi.png"> </p>
<p class="caption">Bidirectionality</p>
</div>
<p>The Unicode standard (<a href="http://www.unicode.org/reports/tr9/">Unicode Standard Annex #9</a>) defines a complex
algorithm for determining the proper ordering of bidirectional text. The
algorithm consists of an implicit part based on character properties,
as well as explicit controls for embeddings and overrides. CSS relies
on this algorithm to achieve proper bidirectional rendering. </p>
<p>Two CSS properties, <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> and <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a>,
provide explicit embedding, isolation, and override controls in the CSS layer.
Because the base directionality of a text depends on the structure and
semantics of the document, the <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> and <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> properties
should in most cases be used only to map bidi information in the markup
to its corresponding CSS styles. </p>
<p class="note" role="note"> The HTML specifications (<a data-link-type="biblio" href="#biblio-html401">[HTML401]</a>, section 8.2, and <a data-link-type="biblio" href="#biblio-html5">[HTML5]</a>, section 10.3.5) define
bidirectionality behavior for HTML elements.</p>
<p class="advisement"> <strong>If a document language provides markup features to control
bidi, authors and users should use those features instead</strong> and not specify CSS rules to override them. </p>
<h3 class="heading settled" data-level="2.1" id="direction"><span class="secno">2.1. </span><span class="content"> Specifying Directionality: the <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property</span><a class="self-link" href="#direction"></a></h3>
<table class="definition propdef" data-link-for-hint="direction">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-direction">direction<a class="self-link" href="#propdef-direction"></a></dfn>
<tr class="value">
<th>Value:
<td class="prod">ltr <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> rtl
<tr>
<th>Initial:
<td>ltr
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
<tr>
<th>Animatable:
<td>no
<tr>
<th>Canonical order:
<td>n/a
</table>
<p class="advisement">Because HTML UAs can turn off CSS styling, <strong>we recommend HTML authors to use the HTML <code>dir</code> attribute and <bdo> element</strong> to ensure correct bidirectional layout in the absence of a style sheet. <strong>Authors <em>should not</em> use <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> in HTML documents.</strong> </p>
<p>This property specifies the <a data-link-type="dfn" href="#inline-base-direction">inline base direction</a> or directionality
of any bidi paragraph, embedding, isolate, or override established by the box.
(See <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a>.)
In addition, it informs the ordering of <a href="http://www.w3.org/TR/CSS21/tables.html">table</a> column layout,
the direction of horizontal <a href="http://www.w3.org/TR/CSS21/visufx.html#overflow">overflow</a>,
and the default alignment of text within a line, and other layout effects
that depend on the box’s inline base direction.</p>
<p>Values for this property have the following meanings:</p>
<dl>
<dt><dfn class="css" data-dfn-for="direction" data-dfn-type="value" data-export="" id="valdef-direction-ltr">ltr<a class="self-link" href="#valdef-direction-ltr"></a></dfn>
<dd>This value sets <a data-link-type="dfn" href="#inline-base-direction">inline base direction</a> (bidi directionality)
to <a data-link-type="dfn" href="#line-left">line-left</a>-to-<a data-link-type="dfn" href="#line-right">line-right</a>.
<dt><dfn class="css" data-dfn-for="direction" data-dfn-type="value" data-export="" id="valdef-direction-rtl">rtl<a class="self-link" href="#valdef-direction-rtl"></a></dfn>
<dd>This value sets <a data-link-type="dfn" href="#inline-base-direction">inline base direction</a> (bidi directionality)
to <a data-link-type="dfn" href="#line-right">line-right</a>-to-<a data-link-type="dfn" href="#line-left">line-left</a>.
</dl>
<p class="note" role="note">The <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property has no effect on bidi reordering
when specified on inline boxes whose <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> property’s
value is <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-normal">normal</a>, because the box does not open an additional level
of embedding with respect to the bidirectional algorithm.</p>
<p class="note" role="note">The <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property, when specified for table column boxes, is not inherited by
cells in the column since columns are not the ancestors of the cells in
the document tree. Thus, CSS cannot easily capture the "dir" attribute
inheritance rules described in <a data-link-type="biblio" href="#biblio-html401">[HTML401]</a>, section 11.3.2.1. </p>
<h3 class="heading settled" data-level="2.2" id="unicode-bidi"><span class="secno">2.2. </span><span class="content"> Embeddings and Overrides: the <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> property</span><a class="self-link" href="#unicode-bidi"></a></h3>
<table class="definition propdef" data-link-for-hint="unicode-bidi">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-unicode-bidi">unicode-bidi<a class="self-link" href="#propdef-unicode-bidi"></a></dfn>
<tr class="value">
<th>Value:
<td class="prod">normal <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> embed <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> isolate <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> bidi-override <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> isolate-override <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> plaintext
<tr>
<th>Initial:
<td>normal
<tr>
<th>Applies to:
<td>all elements, but see prose
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
<tr>
<th>Animatable:
<td>no
</table>
<p class="advisement">Because HTML UAs can turn off CSS styling, <strong>we recommend HTML authors to use the HTML <code>dir</code> attribute, <bdo> element,
and appropriate distinction of text-level vs. grouping-level HTML element types</strong> to ensure correct bidirectional layout in the absence of a style sheet. <strong>Authors <em>should not</em> use <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> in HTML documents.</strong> </p>
<p>Normally (i.e. when <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> is <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-normal">normal</a>)
an inline box is transparent to the unicode bidi algorithm;
content is ordered as if the box’s boundaries were not there.
Other values of the <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> property cause inline boxes
to create scopes within the algorithm,
and to override the intrinsic directionality of text. </p>
<p>The following informative table summarizes the box-internal and
box-external effects of <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a>: </p>
<table class="data">
<caption>Effect of non-<a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-normal">normal</a> values of <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> on inline boxes</caption>
<colgroup span="2"></colgroup>
<colgroup span="2"></colgroup>
<thead>
<tr>
<th colspan="2" rowspan="2">
<th colspan="2" scope="rowgroup"><abbr title="To surrounding contents, the box behaves as if its boundary were...">Outside</abbr>
<tr>
<th><abbr title="a strong character of the box’s 'direction'.">strong</abbr>
<th><abbr title="a neutral character.">neutral</abbr>
<tbody>
<tr>
<th rowspan="3" scope="colgroup"><abbr title="Within the box, content is ordered as if...">Inside</abbr>
<th><abbr title="the box’s boundaries were strong characters of the box’s 'direction'.">scoped</abbr>
<td><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-embed">embed</a>
<td><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-isolate">isolate</a>
<tr>
<th><abbr title="all text consisted of strong characters of the box’s 'direction'.">override</abbr>
<td><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-bidi-override">bidi-override</a>
<td><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-isolate-override">isolate-override</a>
<tr>
<th><abbr title="the box were a standalone paragraph ordered using UAX9 heuristics.">plaintext</abbr>
<td>—
<td><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-plaintext">plaintext</a>
</table>
<p>Values for this property have the following (normative) meanings:</p>
<dl>
<dt><dfn class="css" data-dfn-for="unicode-bidi" data-dfn-type="value" data-export="" id="valdef-unicode-bidi-normal">normal<a class="self-link" href="#valdef-unicode-bidi-normal"></a></dfn>
<dd>The box does not open an additional level of embedding with
respect to the bidirectional algorithm. For inline boxes,
implicit reordering works across box boundaries.
<dt><dfn class="css" data-dfn-for="unicode-bidi" data-dfn-type="value" data-export="" id="valdef-unicode-bidi-embed">embed<a class="self-link" href="#valdef-unicode-bidi-embed"></a></dfn>
<dd>
If the box is inline, this value creates a <dfn data-dfn-type="dfn" data-export="" id="directional-embedding">directional embedding<a class="self-link" href="#directional-embedding"></a></dfn> by opening an additional level of embedding with respect to the bidirectional algorithm.
The direction of this embedding level is given by the <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property. Inside the box, reordering is done implicitly.
<p class="note" role="note">This value has no effect on boxes that are not inline. </p>
<dt><dfn class="css" data-dfn-for="unicode-bidi" data-dfn-type="value" data-export="" id="valdef-unicode-bidi-isolate">isolate<a class="self-link" href="#valdef-unicode-bidi-isolate"></a></dfn>
<dd>
On an inline box, this <dfn data-dfn-type="dfn" data-export="" data-lt="bidi-isolate|bidi-isolated|bidi isolation|isolation" id="bidi-isolate">bidi-isolates<a class="self-link" href="#bidi-isolate"></a></dfn> its contents.
This is similar to a directional embedding (and increases the embedding level accordingly)
except that each sequence of inline-level boxes
uninterrupted by any block boundary or <a data-link-type="dfn" href="#forced-paragraph-break">forced paragraph break</a> is treated as an <dfn data-dfn-type="dfn" data-noexport="" id="isolated-sequence">isolated sequence<a class="self-link" href="#isolated-sequence"></a></dfn>:
<ul>
<li>the content within the sequence is ordered
as if inside an independent paragraph
with the base directionality specified by the box’s <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property.
<li>for the purpose of bidi resolution in its containing bidi paragraph,
the sequence is treated as if it were a single Object Replacement Character (U+FFFC).
</ul>
In effect, neither is the content inside the box bidi-affected
by the content surrounding the box,
nor is the content surrounding the box bidi-affected by the
content or specified directionality of the box.
However, <a data-link-type="dfn" href="#forced-paragraph-break">forced paragraph breaks</a> within the box still create
a corresponding break in the containing paragraph.
<p class="note" role="note">This value has no effect on boxes that are not inline. </p>
<dt><dfn class="css" data-dfn-for="unicode-bidi" data-dfn-type="value" data-export="" id="valdef-unicode-bidi-bidi-override">bidi-override<a class="self-link" href="#valdef-unicode-bidi-bidi-override"></a></dfn>
<dd>This value puts the box’s immediate inline content in a <dfn data-dfn-type="dfn" data-export="" id="directional-override">directional override<a class="self-link" href="#directional-override"></a></dfn>.
For an inline, this means that the box acts like a <a data-link-type="dfn" href="#directional-embedding">directional embedding</a> in the bidirectional algorithm,
except that reordering within it is strictly in sequence according to the <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property; the implicit part of the bidirectional algorithm
is ignored.
For a block container, the override is applied
to an anonymous inline box that surrounds all of its content.
<dt><dfn class="css" data-dfn-for="unicode-bidi" data-dfn-type="value" data-export="" id="valdef-unicode-bidi-isolate-override">isolate-override<a class="self-link" href="#valdef-unicode-bidi-isolate-override"></a></dfn>
<dd>This combines the <a data-link-type="dfn" href="#bidi-isolate">isolation</a> behavior of <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-isolate">isolate</a> with the <a data-link-type="dfn" href="#directional-override">directional override</a> behavior of <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-bidi-override">bidi-override</a>:
to surrounding content, it is equivalent to <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-isolate">isolate</a>,
but within the box content is ordered as if <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-bidi-override">bidi-override</a> were specified.
It effectively nests a <a data-link-type="dfn" href="#directional-override">directional override</a> inside an <a data-link-type="dfn" href="#isolated-sequence">isolated sequence</a>.
<dt><dfn class="css" data-dfn-for="unicode-bidi" data-dfn-type="value" data-export="" id="valdef-unicode-bidi-plaintext">plaintext<a class="self-link" href="#valdef-unicode-bidi-plaintext"></a></dfn>
<dd>
<p>This value behaves as <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-isolate">isolate</a> except that for the purposes of
the Unicode bidirectional algorithm, the base directionality of each
of the box’s <a data-link-type="dfn" href="#bidi-paragraph">bidi paragraphs</a> (if a block container)
or <a data-link-type="dfn" href="#isolated-sequence">isolated sequences</a> (if an inline)
is determined by following the heuristic in rules P2 and P3
of the Unicode bidirectional algorithm
(rather than by using the <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property of the box). </p>
</dl>
<p>Following Unicode Bidirectional Algorithm clause HL3 <a data-link-type="biblio" href="#biblio-uax9">[UAX9]</a>,
values other than <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-normal">normal</a> effectively insert the corresponding Unicode bidi control codes
into the text stream at the start and end of the inline element
before passing the paragraph to the Unicode bidirectional algorithm for reordering.
(See <a href="#bidi-control-codes">§2.4.2 CSS–Unicode Bidi Control Translation, Text Reordering</a>.) </p>
<table class="data">
<caption>Bidi control codes injected by <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> at the start/end of <a class="css" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-display">display: inline</a> boxes</caption>
<colgroup span="1"></colgroup>
<colgroup span="2"></colgroup>
<colgroup span="2"></colgroup>
<thead>
<tr>
<th rowspan="3" scope="col"><a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> value
<th colspan="4"><a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> value
<tr>
<th colspan="2"><a class="css" data-link-type="maybe" href="#valdef-direction-ltr">ltr</a>
<th colspan="2"><a class="css" data-link-type="maybe" href="#valdef-direction-rtl">rtl</a>
<tr>
<th>start
<th>end
<th>start
<th>end
<tbody>
<tr>
<th scope="row"><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-normal">normal</a>
<td>—
<td>—
<td>—
<td>—
<tr>
<th scope="row"><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-embed">embed</a>
<td>LRE (U+202A)
<td>PDF (U+202C)
<td>RLE (U+202B)
<td>PDF (U+202C)
<tr>
<th scope="row"><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-isolate">isolate</a>
<td>LRI (U+2066)
<td>PDI (U+2069)
<td>RLI (U+2067)
<td>PDI (U+2069)
<tr>
<th scope="row"><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-bidi-override">bidi-override</a>*
<td>LRO (U+202D)
<td>PDF (U+202C)
<td>RLO (U+202E)
<td>PDF (U+202C)
<tr>
<th scope="row"><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-isolate-override">isolate-override</a>*
<td>FSI,LRO (U+2068,U+202D)
<td>PDF,PDI (U+202C,U+2069)
<td>FSI,RLO (U+2068,U+202E)
<td>PDF,PDI (U+202C,U+2069)
<tr>
<th scope="row"><a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-plaintext">plaintext</a>
<td>FSI (U+2068)
<td>PDI (U+2069)
<td>FSI (U+2068)
<td>PDI (U+2069)
<tfoot>
<tr>
<td colspan="5"> <small>* The LRO/RLO+PDF pairs are also applied
to the <a data-link-type="dfn">root inline box</a> of a <a data-link-type="dfn" href="http://www.w3.org/TR/css-display-3/#block-container">block container</a> if these values of <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> were specified on the <a data-link-type="dfn" href="http://www.w3.org/TR/css-display-3/#block-container">block container</a>. </small>
</table>
<p class="note" role="note">Because the <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> property does not inherit,
setting <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-bidi-override">bidi-override</a> or <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-plaintext">plaintext</a> on a block box will
not affect any descendant blocks. Therefore these values are best
used on blocks and inlines that do not contain any block-level
structures. </p>
<p class="note" role="note">Note that <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> does not affect the <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property even in the case of <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-plaintext">plaintext</a>, and thus does not affect <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a>-dependent layout calculations. </p>
<p class="note" role="note"> Because the Unicode algorithm has a limit of 125 levels of embedding,
care should be taken not to overuse <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> values other than <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-normal">normal</a>.
In particular, a value of <a class="css" data-link-type="maybe" href="http://www.w3.org/TR/css-cascade-3/#valdef-all-inherit">inherit</a> should be used with extreme caution in deeply nested inline markup.
However, for elements that are,
in general, intended to be displayed as blocks, a setting of <a class="css" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi: isolate</a> is preferred to keep the element together
in case the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-display">display</a> is changed to <a class="css" data-link-type="maybe" href="http://www.w3.org/TR/css-display-3/#valdef-display-inline">inline</a> (see example below). </p>
<h3 class="heading settled" data-level="2.3" id="bidi-example"><span class="secno">2.3. </span><span class="content"> Example of Bidirectional Text</span><a class="self-link" href="#bidi-example"></a></h3>
<p>The following example shows an XML document with bidirectional
text. It illustrates an important design principle: document language
designers should take bidi into account both in the language proper
(elements and attributes) and in any accompanying style sheets. The
style sheets should be designed so that bidi rules are separate from
other style rules, and such rules should not be overridden by other
style sheets so that the document language’s bidi behavior is preserved.</p>
<div class="example" id="example-0342f8aa">
<a class="self-link" href="#example-0342f8aa"></a>
<p>In this example, lowercase letters stand for inherently left-to-right
characters and uppercase letters represent inherently right-to-left
characters. The text stream is shown below in logical backing store order.</p>
<pre class="xml-example"><section dir=rtl>
<para>HEBREW1 HEBREW2 english3 HEBREW4 HEBREW5</para>
<para>HEBREW6 <emphasis>HEBREW7</emphasis> HEBREW8</para>
</section>
<section dir=ltr>
<para>english9 english10 english11 HEBREW12 HEBREW13</para>
<para>english14 english15 english16</para>
<para>english17 <quote dir=rtl>HEBREW18 english19 HEBREW20</quote></para>
</section>
</pre>
<p>Since this is arbitrary XML, the style sheet is responsible for
setting the writing direction. This is the style sheet:</p>
<pre>/* Rules for bidi */
[dir=ltr] {direction: rtl; unicode-bidi: isolate; }
[dir=rtl] {direction: ltr; unicode-bidi: isolate; }
/* Rules for presentation */
section, para {display: block;}
emphasis {font-weight: bold;}
quote {font-style: italic;}
</pre>
<p>If the line length is long,
the formatting of this text might look like this:</p>
<pre class="ascii-art"> 5WERBEH 4WERBEH english3 2WERBEH 1WERBEH
8WERBEH <b>7WERBEH</b> 6WERBEH
english9 english10 english11 13WERBEH 12WERBEH
english14 english15 english16
english17 <i data-lt="">20WERBEH english19 18WERBEH</i>
</pre>
<p>The first <code><section></code> element is a block with a right-to-left base direction,
the second <code><section></code> element is a block with a left-to-right base direction.
The <code><para></code>s are blocks that inherit the base direction from their parents.
Thus, the first two <code><para></code>s are read starting at the top right,
the final three are read starting at the top left.</p>
<p>The <code><emphasis></code> element is inline-level,
and since its value for <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> is <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-normal">normal</a> (the initial value),
it has no effect on the ordering of the text. </p>
<p>The <code><quote></code> element, on the other hand,
creates an <a data-link-type="dfn" href="#isolated-sequence">isolated sequence</a> with the given internal directionality.
Note that this causes <samp>HEBREW18</samp> to be to the right of <samp>english19</samp>. </p>
<p>If lines have to be broken, the same text might format like this:</p>
<pre class="ascii-art"> 2WERBEH 1WERBEH
-EH 4WERBEH english3
5WERB
-EH <b>7WERBEH</b> 6WERBEH
8WERB
english9 english10 en-
glish11 12WERBEH
13WERBEH
english14 english15
english16
english17 <i data-lt="">18WERBEH
20WERBEH english19</i>
</pre>
<p>Notice that because <samp>HEBREW18</samp> must be read before <samp>english19</samp>,
it is on the line above <samp>english19</samp>.
Just breaking the long line from the earlier formatting would not have worked. </p>
<p>Note also that the first syllable from <samp>english19</samp> might have fit on the previous line,
but hyphenation of left-to-right words in a right-to-left context, and vice versa,
is usually suppressed to avoid having to display a hyphen in the middle of a line. </p>
</div>
<h3 class="heading settled" data-level="2.4" id="bidi-algo"><span class="secno">2.4. </span><span class="content"> Applying the Bidirectional Reordering Algorithm</span><a class="self-link" href="#bidi-algo"></a></h3>
<p>User agents that support bidirectional text must apply the Unicode
bidirectional algorithm to every sequence of inline-level boxes uninterrupted
by any block boundary or
“<a href="http://www.unicode.org/reports/tr9/#Bidirectional_Character_Types">bidi type B</a>” <dfn data-dfn-type="dfn" data-export="" id="forced-paragraph-break">forced paragraph break<a class="self-link" href="#forced-paragraph-break"></a></dfn>.
This sequence forms the <dfn data-dfn-type="dfn" data-export="" data-lt="bidi paragraph" id="bidi-paragraph">paragraph<a class="self-link" href="#bidi-paragraph"></a></dfn> unit
in the bidirectional algorithm. </p>
<h4 class="heading settled" data-level="2.4.1" id="bidi-para-direction"><span class="secno">2.4.1. </span><span class="content"> Bidi Paragraph Embedding Levels</span><a class="self-link" href="#bidi-para-direction"></a></h4>
<p>In CSS,
the paragraph embedding level must be set
(following <a href="http://www.unicode.org/reports/tr9/#HL1">UAX9 clause HL1</a>)
according to the <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property of the paragraph’s containing block
rather than by the heuristic given in steps <a href="http://www.unicode.org/reports/tr9/#P2">P2</a> and <a href="http://www.unicode.org/reports/tr9/#P2">P3</a> of the Unicode algorithm. </p>
<p>There is, however, one exception:
when the computed <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> of the paragraph’s containing block is <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-plaintext">plaintext</a>,
the Unicode heuristics in P2 and P3 are used as described in <a data-link-type="biblio" href="#biblio-uax9">[UAX9]</a>,
without the HL1 override. </p>
<h4 class="heading settled" data-level="2.4.2" id="bidi-control-codes"><span class="secno">2.4.2. </span><span class="content"> CSS–Unicode Bidi Control Translation, Text Reordering</span><a class="self-link" href="#bidi-control-codes"></a></h4>
<p>The final order of characters within each <a data-link-type="dfn" href="#bidi-paragraph">bidi paragraph</a> is the
same as if the bidi control codes had been added as described for <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> (above),
markup had been stripped, and the resulting character sequence had
been passed to an implementation of the Unicode bidirectional
algorithm for plain text that produced the same line-breaks as the
styled text. </p>
<p class="note" role="note"> Note that bidi control codes in the source text are still honored,
and might not correspond to the document tree structure.
This can split inlines or interfere with bidi start/end control pairing
in interesting ways. </p>
<h4 class="heading settled" data-level="2.4.3" id="bidi-atomic-inlines"><span class="secno">2.4.3. </span><span class="content"> Bidi Treatment of Atomic Inlines</span><a class="self-link" href="#bidi-atomic-inlines"></a></h4>
<p>In this process, replaced elements with <a class="css" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-display">display: inline</a> are treated as neutral characters,
unless their <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> property is either <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-embed">embed</a> or <a class="css" data-link-type="maybe" href="#valdef-unicode-bidi-bidi-override">bidi-override</a>,
in which case they are treated as strong characters
in the <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> specified for the element.
(This is so that, in case the replaced element falls back to rendering inlined text content,
its bidi effect on the surrounding text is consistent with its replaced rendering.) </p>
<p>All other atomic inline-level boxes are treated as neutral characters
always.</p>
<h4 class="heading settled" data-level="2.4.4" id="bidi-embedding-breaks"><span class="secno">2.4.4. </span><span class="content"> Paragraph Breaks Within Embeddings and Isolates</span><a class="self-link" href="#bidi-embedding-breaks"></a></h4>
<p>If an inline box is broken around a <a data-link-type="dfn" href="#bidi-paragraph">bidi paragraph</a> boundary
(e.g. if split by a block or <a data-link-type="dfn" href="#forced-paragraph-break">forced paragraph break</a>),
then the <a href="http://www.unicode.org/reports/tr9/#HL3">HL3</a> bidi control codes assigned to the end of the box
are also added before the interruption
and the codes assigned to the start of the box are also added after it.
(In other words, any embedding levels, isolates, or overrides started by the box
are closed at the paragraph break and reopened on the other side of it.) </p>
<div class="example" id="example-8a82340a">
<a class="self-link" href="#example-8a82340a"></a>
<p>For example, where <BR/> is a <a data-link-type="dfn" href="#forced-paragraph-break">forced paragraph break</a> the bidi ordering is identical between </p>
<pre><para>...<i1><i2>...<BR/>...</i2></i1>...</para></pre>
<p>and </p>
<pre><para>...<i1><i2>...</i2></i1><BR/><i1><i2>...</i2></i1>...</para></pre>
<p>for all values of <a class="property" data-link-type="propdesc" href="#propdef-unicode-bidi">unicode-bidi</a> on inline elements <i1> and <i2>. </p>
</div>
<p class="note" role="note"> Note that this behavior is applied by CSS for CSS-declared bidi controls
applied to the box tree;
it does not apply to Unicode’s bidi formatting controls,
which are defined to terminate their effect at the end of the bidi paragraph. </p>
<h4 class="heading settled" data-level="2.4.5" id="bidi-box-model"><span class="secno">2.4.5. </span><span class="content"> Reordering-induced Box Fragmentation</span><a class="self-link" href="#bidi-box-model"></a></h4>
<p>Since bidi reordering can split apart and reorder text that is
logically contiguous, bidirectional text can cause an inline box
to be split and reordered within a line. </p>
<p class="note" role="note">Note that in order to be able to flow inline boxes in a
uniform direction (either entirely left-to-right or entirely
right-to-left), anonymous inline boxes may have to be created.</p>
<p>For each line box, UAs must take the fragments of each inline box
and render the margins, borders and padding in visual order (not logical order).
The <a data-link-type="dfn" href="#start">start</a>-most fragment on the first line box in which the box appears
has the <a data-link-type="dfn" href="#start">start</a> edge’s margin, border, and padding;
and the end-most fragment on the last line box in which the box appears
has the <a data-link-type="dfn" href="#end">end</a> edge’s margin, border, and padding.
For example, in the <a class="css" data-link-type="maybe" href="#valdef-writing-mode-horizontal-tb">horizontal-tb</a> writing mode: </p>
<ul>
<li>When the parent’s <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property is <a class="css" data-link-type="maybe" href="#valdef-direction-ltr">ltr</a>,
the left-most box fragment on the first line box in which the box appears
has the left margin, left border and left padding,
and the right-most box fragment on the last line box in which the box appears
has the right padding, right border and right margin.
<li>When the parent’s <a class="property" data-link-type="propdesc" href="#propdef-direction">direction</a> property is <a class="css" data-link-type="maybe" href="#valdef-direction-rtl">rtl</a>,
the right-most fragment of the first line box in which the box appears
has the right padding, right border and right margin,
and the left-most fragment of the last line box in which the box appears
has the left margin, left border and left padding.
</ul>
<p>Analogous rules hold for vertical writing modes.</p>
<p class="note" role="note">The <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-break/#box-decoration-break">box-decoration-break</a> property can override this behavior
to draw box decorations on both sides of each fragment. <a data-link-type="biblio" href="#biblio-css3-break">[CSS3-BREAK]</a> </p>
<h2 class="heading settled" data-level="3" id="vertical-intro"><span class="secno">3. </span><span class="content"> Introduction to Vertical Text</span><a class="self-link" href="#vertical-intro"></a></h2>
<p><em>This subsection is non-normative.</em></p>
<p>In addition to extensions to CSS2.1’s support for bidirectional text,
this module introduces the rules and properties needed to support vertical
text layout in CSS. </p>
<p>Unlike languages that use the Latin script which are primarily laid out
horizontally, Asian languages such as Chinese and Japanese can be laid out
vertically. The Japanese example below shows the same te
DDF0
xt laid out
horizontally and vertically. In the horizontal case, text is read
from left to right, top to bottom. For the vertical case, the text is
read top to bottom, right to left.
Indentation from the left edge in the left-to-right horizontal case
translates to indentation from the top edge in the top-to-bottom vertical
case. </p>
<div class="figure">
<p><img alt="A comparison of horizontal and vertical Japanese shows that
although the lines rotate, the characters remain upright.
Some glyphs, however change: a period mark shifts from the
bottom left of its glyph box to the top right. Running
headers, however, may remain
laid out horizontally across the top of the page." src="images/vert-horiz-comparison.png"></p>
<p class="caption">Comparison of vertical and horizontal Japanese: iBunko application (iOS)</p>
</div>
<p class="note" role="note">For Chinese and Japanese lines are ordered either right
to left or top to bottom, while for Mongolian and Manchu lines are
ordered left to right.</p>
<p>The change from horizontal to vertical writing can affect not just the
layout, but also the typesetting. For example, the position of a punctuation
mark within its spacing box can change from the horizontal to the
vertical case, and in some cases alternate glyphs are used. </p>
<p>Vertical text that includes Latin script text or text from other scripts
normally displayed horizontally can display that text in a number of
ways. For example, Latin words can be rotated sideways, or each letter
can be oriented upright: </p>
<div class="figure">
<p><img alt="A dictionary definition for ヴィルス
might write the English word 'virus' rotated 90° clockwise,
but stack the letters of the initialisms 'RNA' and 'DNA' upright." src="images/vert-latin-layouts.png"></p>
<p class="caption">Examples of Latin in vertical Japanese: Daijirin Viewer 1.4 (iOS) </p>
</div>
<p>In some special cases such as two-digit numbers in dates, text is fit
compactly into a single vertical character box: </p>
<div class="figure" id="fig-mac">
<p><img alt="An excerpt from MacFan shows several possible vertical layouts
for numbers: the two-digit month and day are written as
horizontal-in-vertical blocks; the years are written with
each character upright; except in the English phrase
“for Mac 2011”, where the date is rotated to
match the rotated Latin." src="images/vert-number-layouts.png"></p>
<p class="caption">Mac Fan, December 2010, p.49</p>
</div>
<p>Layouts often involve a mixture of vertical and horizontal elements: </p>
<div class="figure">
<p><img alt="Magazines often mix horizontal and vertical layout; for
example, using one orientation for the main article text
and a different one for sidebar or illustrative content." src="images/vert-horiz-combination.png"></p>
<p class="caption">Mixture of vertical and horizontal elements</p>
</div>
<p>Vertical text layouts also need to handle bidirectional text layout;
clockwise-rotated Arabic, for example, is laid out bottom-to-top. </p>
<h3 class="heading settled" data-level="3.1" id="block-flow"><span class="secno">3.1. </span><span class="content"> Block Flow Direction: the <a class="property" data-link-type="propdesc" href="#propdef-writing-mode">writing-mode</a> property</span><a class="self-link" href="#block-flow"></a></h3>
<table class="definition propdef" data-link-for-hint="writing-mode">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-writing-mode">writing-mode<a class="self-link" href="#propdef-writing-mode"></a></dfn>
<tr class="value">
<th>Value:
<td class="prod">horizontal-tb <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> vertical-rl <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> vertical-lr <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> sideways-rl <a data-link-type="grammar" href="http://www.w3.org/TR/css3-values/#comb-one">|</a> sideways-lr
<tr>
<th>Initial:
<td>horizontal-tb
<tr>
<th>Applies to:
<td>All elements except table row groups, table column groups, table rows, table columns, ruby base container, ruby annotation container
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
<tr>
<th>Animatable:
<td>no
<tr>
<th>Canonical order:
<td>n/a
</table>
<p>This property specifies whether lines of text are laid out horizontally
or vertically and the direction in which blocks progress. Possible
values:</p>
<dl>
<dt><dfn class="css" data-dfn-for="writing-mode" data-dfn-type="value" data-export="" id="valdef-writing-mode-horizontal-tb">horizontal-tb<a class="self-link" href="#valdef-writing-mode-horizontal-tb"></a></dfn>
<dd>Top-to-bottom <a data-link-type="dfn" href="#block-flow-direction">block flow direction</a>.
Both the <a data-link-type="dfn" href="#writing-mode">writing mode</a> and the <a data-link-type="dfn" href="#typographic-mode">typographic mode</a> are horizontal.
<dt><dfn class="css" data-dfn-for="writing-mode" data-dfn-type="value" data-export="" id="valdef-writing-mode-vertical-rl">vertical-rl<a class="self-link" href="#valdef-writing-mode-vertical-rl"></a></dfn>
<dd>Right-to-left <a data-link-type="dfn" href="#block-flow-direction">block flow direction</a>.
Both the <a data-link-type="dfn" href="#writing-mode">writing mode</a> and the <a data-link-type="dfn" href="#typographic-mode">typographic mode</a> are vertical.
<dt><dfn class="css" data-dfn-for="writing-mode" data-dfn-type="value" data-export="" id="valdef-writing-mode-vertical-lr">vertical-lr<a class="self-link" href="#valdef-writing-mode-vertical-lr"></a></dfn>
<dd>Left-to-right <a data-link-type="dfn" href="#block-flow-direction">block flow direction</a>.
Both the <a data-link-type="dfn" href="#writing-mode">writing mode</a> and the <a data-link-type="dfn" href="#typographic-mode">typographic mode</a> are vertical.
<dt><dfn class="css" data-dfn-for="writing-mode" data-dfn-type="value" data-export="" id="valdef-writing-mode-sideways-rl">sideways-rl<a class="self-link" href="#valdef-writing-mode-sideways-rl"></a></dfn>
<dd>
Right-to-left <a data-link-type="dfn" href="#block-flow-direction">block flow direction</a>.
The <a data-link-type="dfn" href="#writing-mode">writing mode</a> is vertical, while the <a data-link-type="dfn" href="#typographic-mode">typographic mode</a> is horizontal.
<p class="note" role="note">This value is at-risk and may be dropped during CR. </p>
<dt><dfn class="css" data-dfn-for="writing-mode" data-dfn-type="value" data-export="" id="valdef-writing-mode-sideways-lr">sideways-lr<a class="self-link" href="#valdef-writing-mode-sideways-lr"></a></dfn>
<dd>
Left-to-right <a data-link-type="dfn" href="#block-flow-direction">block flow direction</a>.
The <a data-link-type="dfn" href="#writing-mode">writing mode</a> is vertical, while the <a data-link-type="dfn" href="#typographic-mode">typographic mode</a> is horizontal.
<p class="note" role="note">This value is at-risk and may be dropped during CR. </p>
</dl>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-writing-mode">writing-mode</a> property specifies the <a data-link-type="dfn" href="#block-flow-direction">block flow direction</a>,
which determines the ordering direction of block-level boxes in a block formatting context;
the ordering direction of line boxes in a block container that contains inlines;
the ordering direction of rows in a table; etc.
By virtue of determining the stacking direction of line boxes,
the <a class="property" data-link-type="propdesc" href="#propdef-writing-mode">writing-mode</a> property also determines whether the line boxes' orientation (and thus the <a data-link-type="dfn" href="#writing-mode">writing mode</a>)
is horizontal or vertical.
The <a class="property" data-link-type="propdesc" href="#propdef-text-orientation">text-orientation</a> property then determines how text is laid out within the line box. </p>
<p>The content of replaced elements do not rotate due to the writing mode:
images and external content such as from <code><iframe></code>s, for example, remain upright,
and the <a data-link-type="dfn" href="http://www.w3.org/TR/css3-images/#default-object-size">default object size</a> of 300px×150px does not re-orient.
However embedded replaced content involving text
(such as MathML content or form elements)
should match the replaced element’s writing mode and line orientation
if the UA supports such a vertical writing mode for the replaced content. </p>
<div class="example" id="example-9e085a32">
<a class="self-link" href="#example-9e085a32"></a>
<p>In the following example, two block elements (1 and 3) separated
by an image (2) are presented in various flow writing modes.</p>
<p>Here is a diagram of horizontal writing mode (<code>writing-mode: horizontal-tb</code>):</p>
<p><img alt="Diagram of horizontal layout: blocks 1, 2, and 3 are stacked top-to-bottom" height="300" src="images/horizontal.png" width="219"></p>
<p>Here is a diagram for the right-to-left vertical writing mode commonly
used in East Asia (<code>writing-mode: vertical-rl</code>):</p>
<p><img alt="Diagram of a right-to-left vertical layout: blocks 1, 2,
and 3 are arranged side by side from right to left" height="191" src="images/vertical-rl.png" width="297"></p>
<p>And finally, here is a diagram for the left-to-right vertical
writing mode used for Manchu and Mongolian (<code>writing-mode: vertical-lr</code>):</p>
<p><img alt="Diagram of left-to-right vertical layout: blocks 1, 2,
and 3 are arranged side by side from left to right" height="191" src="images/vertical-lr.png" width="300"></p>
</div>
<div class="example" id="example-18096584">
<a class="self-link" href="#example-18096584"></a>
<p>In the following example, some form controls are rendered inside
a block with <a class="css" data-link-type="maybe" href="#valdef-writing-mode-vertical-rl">vertical-rl</a> writing mode. The form controls are
rendered to match the writing mode. </p>
<pre><style>
form { writing-mode: vertical-rl; }
</style>
...
<form>
<p><label>姓名 <input value="艾俐俐"></label>
<p><label>语言 <select><option>English
<option>français
<option>فارسی