HTML - (Element text Directionality | dir attribute)

1 - About

The dir global attribute specifies the element's text directionality.

3 - Syntax

The attribute is an enumerated attribute with the following keywords:

  • The ltr keyword (left-to-right text) (default)
  • The rtl keyword (right-to-left text)
  • The auto keyword (The direction is determined programmatically using the contents of the element)

4 - Example

4.1 - ltr

The direction ltr is applied as an attribute of the blockquote HTML element


<blockquote dir=ltr>
<p>I didn't like the play, but then I saw
it under adverse conditions - the curtain was up.</p>
<cite>- Groucho Marx</cite>
</blockquote>

4.2 - rtl

The direction rtl is applied using Css.


<blockquote>
<p>I didn't like the play, but then I saw
it under adverse conditions - the curtain was up.</p>
<cite>- Groucho Marx</cite>
</blockquote>


blockquote {
  direction: rtl;
}

5 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap