You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: questions/qa-html-dir.en.html
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ <h1>Structural markup and right-to-left text in HTML</h1>
67
67
68
68
<p>This article looks at ways of handling text direction for <em>structural</em> markup in HTML, ie. at the document level and for elements like paragraphs, tables and forms.</p>
69
69
70
-
<pclass="warning">For handling <ahref="https://w3c.github.io/i18n-glossary/#def_bidirectional_text" class="termref print">bidirectional text</a> with <em>inline</em> markup you should read the separate article, <cite><aclass="print" href="/International/articles/inline-bidi-markup/">Inline markup and bidirectional text in HTML</a></cite>. It also describes some other elements and attributes related to direction.</p>
70
+
<pclass="warning">For handling <ahref="https://www.w3.org/TR/i18n-glossary/#dfn-bidirectional-text" class="termref print">bidirectional text</a> with <em>inline</em> markup you should read the separate article, <cite><aclass="print" href="/International/articles/inline-bidi-markup/">Inline markup and bidirectional text in HTML</a></cite>. It also describes some other elements and attributes related to direction.</p>
71
71
72
72
<p>The <codeclass="kw" translate="no">dir</code> attribute is used to set the base direction of text for display. It is essential to support languages that use right-to-left scripts such as Adlam, Arabic, Hebrew, N'Ko, Syriac, and Thaana. Many different languages are written with these scripts, including Arabic, Dhivehi, Hebrew, Mandinka, Pashto, Persian, Pular, Sindhi, Syriac, Urdu, Yiddish, etc.</p>
73
73
</div>
@@ -102,16 +102,16 @@ <h2>Setting direction at the document level</h2>
102
102
103
103
104
104
105
-
<section>
106
-
<h3id="basedirection">Base direction</h3>
105
+
<sectionid="basedirection">
106
+
<h3>Base direction</h3>
107
107
108
108
<divclass="insideinfonote">
109
109
<pclass="info noprint">Examples in this document may be shown as images to avoid problems for those with a browser that doesn't produce what was intended. </p>
110
110
111
111
<p>Code samples containing Arabic and Hebrew text <aclass="print" href="https://www.w3.org/TR/i18n-html-tech-bidi/#bidisource"> may be displayed in different ways</a>, none of which are usually satisfactory. In this article right-to-left text in code samples may be represented by UPPERCASE TRANSLATIONS, and left-to-right text by lowercase.</p>
112
112
</div>
113
113
114
-
<pclass="info">At the outset, it is important to understand the concept of <ahref="https://w3c.github.io/i18n-glossary/#dfn-base-direction" target="_blank" class="termref print">base direction</a> (see <ahref="../articles/inline-bidi-markup/uba-basics">Unicode Bidirectional Algorithm basics</a> for a simple overview of how it works with the <ahref="https://w3c.github.io/i18n-glossary/#dfn-unicode-bidi-algorithm" target="_blank" class="termref print">Unicode bidirectional algorithm</a>). </p>
114
+
<pclass="info">At the outset, it is important to understand the concept of <ahref="https://www.w3.org/TR/i18n-glossary/#dfn-base-direction" target="_blank" class="termref print">base direction</a> (see <ahref="../articles/inline-bidi-markup/uba-basics">Unicode Bidirectional Algorithm basics</a> for a simple overview of how it works with the <ahref="https://www.w3.org/TR/i18n-glossary/#dfn-unicode-bidi-algorithm" target="_blank" class="termref print">Unicode bidirectional algorithm</a>). </p>
115
115
116
116
<p>It is fundamentally important to establish the appropriate base direction for the text, so that the Unicode bidirectional algorithm can reorder the text appropriately when it is displayed. Correctly setting the base direction also sets the default paragraph alignment of the text.</p>
117
117
@@ -170,7 +170,7 @@ <h3>Setting up a right-to-left page</h3>
170
170
<sectionid="lang_tags">
171
171
<h4>Language tags</h4>
172
172
173
-
<p>While you are declaring the directionality of the document in the <spanclass="kw">html</span> tag, don't forget to also declare the <em>language</em> of the document using the <spanclass="kw">lang</span> attribute (see <aclass="print" href="/International/questions/qa-html-language-declarations">Declaring language in HTML</a>). However, do not make the mistake of assuming that language declarations indicate directionality, or vice versa! Even if the language declaration has a script tag it won't affect the directionality of the text in the user agent. You must always declare the directionality using the <spanclass="kw">dir</span> attribute.</p>
173
+
<p>While you are declaring the directionality of the document in the <spanclass="kw">html</span> tag, don't forget to also declare the <em>language</em> of the document using the <spanclass="kw">lang</span> attribute (see <aclass="print" href="/International/questions/qa-html-language-declarations">Declaring language in HTML</a>). However, do not make the mistake of assuming that language declarations indicate directionality, or vice versa! Even if the language declaration has a script subtag it won't affect the directionality of the text in the user agent. You must always declare the directionality using the <spanclass="kw">dir</span> attribute.</p>
<p>Much of the time this will produce the desired result. However, if the title text in a RTL document begins with, say, an acronym in the Latin script, the order will be incorrect when the text is displayed (<aclass="print" href="https://www.w3.org/International/i18n-tests/results/native-user-interfaces#windowheader" target="_blank">see some tests</a>).</p>
203
203
204
-
<p>A workaround for this scenario is to add <code>&rlm;</code> at the beginning of the title text when it doesn't begin with a RTL character. This adds <spanclass="codepoint" translate="no"><spanclass="uname">U+200F RIGHT-TO-LEFT MARK</span></span> at the start, which is an invisible, strongly directional RTL character.</p>
204
+
<p>A workaround for this scenario is to add <code>&rlm;</code> at the beginning of the title text when it doesn't begin with a RTL character. This adds <spanclass="codepoint" translate="no"><codeclass="uname">U+200F RIGHT-TO-LEFT MARK</code></span> at the start, which is an invisible, strongly directional RTL character.</p>
205
205
<p>If you have a LTR text that begins with a strong RTL character, use <code>&lrm;</code> at the start, instead.</p>
206
206
</section>
207
207
</section>
@@ -705,7 +705,7 @@ <h2>Further reading</h2>
705
705
</li>
706
706
707
707
<li>
708
-
<p>Related links, <cite>Authoring HTML & CSS</cite></p>
708
+
<p>Related links, <cite>Authoring web pages</cite></p>
0 commit comments