HTML dir attribute - HTML and XHTML attributes - Guide to HTML, XHTML Guide

Change Font Size: / / Directory List

HTML dir attribute

Dir attribute - Definitions (text) arrangement
  • Value:
    • Ltr - representatives of the left-to-right sequence
    • Rtl - on behalf of the right-to-left sequence
  • Default: ltr
  • Trackback Address: http://www.nt22.com/xhtml-html/attribute_dir/

Example

Ltr left-to-right alignment way

  <html Xmlns "http://www.w3.org/1999/xhtml" dir = = = "zh-CN" "ltr" xml:lang> 

Rtl right to left Alignment

  <html Xmlns "http://www.w3.org/1999/xhtml" dir = = = "zh-CN" "rtl" xml:lang> 

Description:

  • Dir attribute is the international one.
  • Dir attribute definition of the text in the browser in the direction of order.
  • If the definition of the entire HTML documents should be arranged in the direction of html tags dir attribute in the definition of other HTML tags can also be defined dir attribute.
  • Ltr dir is the common values, some languages (such as Arabic), is read from right to left, it should take rtl.

Extended reading

Reference