HTML - (Element text Directionality | dir attribute)

About

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

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 ttb keyword (top-to-bottom). Example: chinese
  • The auto keyword (The direction is determined programmatically using the contents of the element)

Example

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>

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;
}

Documentation / Reference





Discover More
CSS - Block Level (element|box)

Block-level refers to the (HTML) elements that are formatted visually as blocks. See for more information: Except for table boxes, and replaced elements, a block-level box can also be a block container...
CSS - Position Property

The position property specifies the positioning algorithms (positioning scheme) for elements. The position is calculated with respect to the edges of a rectangular box called the containing block. ...
block directioninlinedirectionverticalwriting mode中文▼ left / block-end sideright / block-start side ▼top / inline-start side ▼bottom / inline-end side ▲width / block-sizeheight / inline-size
CSS - Flow

The flow is the direction of a block and inline layout against which the elements are positioned. This layout uses the concept of containing box as coordinate system. This containing box depends...
HTML - Global (Element) Attribute

The global-attributesglobal attributes are common attribute to all elements in the HTML language.
Data System Architecture
Text - Order

Order in text data is defined by: the order of character in the character set. the language directionality collation collation page The language directionality (known also as character order)...



Share this page:
Follow us:
Task Runner