The original version of text in uppercase translations would be read from right-to-left. All text in code samples reflects the direction of characters as stored in memory, rather than the displayed result. In this article right-to-left text in code samples is represented by UPPERCASE TRANSLATIONS, and left-to-right text by lowercase. Many examples in this document are shown as images to avoid problems for those with a browser that doesn't produce what was intended.Ĭlick on the image to see how it looks in your browser, and to see the actual text.Ĭode samples containing Arabic and Hebrew text may be displayed in different ways depending on which editor is used. Setting direction at the document level Base direction Handling bidirectional inline text is more complicated and is dealt with in a separate article, Inline markup and bidirectional text in HTML. Consider using the dirname attribute on forms to send information about direction in addition to the usual form data. Use dir="auto" on forms and inserted text in order to automatically detect the direction of content supplied at run-time. Support for the following HTML5 markup is increasing. (There is a workaround if you absolutely need to avoid Internet Explorer or Opera changing the browser chrome.)īelow the html tag, only use the dir attribute on structural elements where the base direction needs to change in order for the text to display correctly. If the overall document direction is right-to-left, add dir="rtl" to the html tag. It also describes some other elements and attributes related to direction. For handling bidirectional text with inline markup you should read the separate article, Inline markup and bidirectional text in HTML. This article looks at basic usage of the dir attribute for structural markup in HTML, at the document level and for elements like paragraphs, tables and forms. Numerous different languages are written with these scripts, including Arabic, Hebrew, Pashto, Persian, Sindhi, Syriac, Dhivehi, Urdu, Yiddish, etc. It is essential for enabling HTML in right-to-left scripts such as Arabic, Hebrew, Syriac, and Thaana. The dir attribute is used to set the base direction of text for display. How should I use the dir attribute and related markup to set text direction on structural elements in HTML?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |