Global Attributes

dir="rtl"

Build a form with the HTML form generator

Sets the base direction to right-to-left, for example for Persian or Arabic text. Latin words and numbers can still form left-to-right runs within the paragraph. Global enumerated attribute; absent or invalid values normally inherit direction (bdi has a special auto default). Use lang separately.

Formal Syntax & Structure

html syntaxhtml
dir="rtl"

Parameters & Attributes

NameTypeDescription
dirkeywordSets the base direction to right-to-left, for example for Persian or Arabic text. Latin words and numbers can still form left-to-right runs within the paragraph.

Working Example

Example Snippethtml
<p dir="rtl">سلام دنیا</p>
HTML Reference