directions can help making the underlined page or section Left-to-Right or Right-to-left oriented. It’s most common use is for right to left languages like Arabic.
Directions can be applied to the whole page or body, or to specific sections.
To apply right to left direction to the whole page you may write:
To apply it to a section like:
Note that while the outer tag which is the <div> directs the text under it from right to left; the inner second paragraph from left to right.
As a rule, when ever an inner tag in an HTML code have a different formatting from its parent, the inner one always has the priority.
If your browser can read Arabic, here is an example using the right-to-left direction to and Arabic text:
<span dir="RTL">السلام عليكم </span>
<h2 dir=”ltr”>The above sentence is a greeting in Arabic </h2>