HTML -dir- Attribut


Beispiel

Ein Absatz mit einer Richtung von rechts nach links:

<p dir="rtl">Write this text right-to-left!</p>

Definition und Verwendung

Das dirAttribut gibt die Textrichtung des Inhalts des Elements an.


Browser-Unterstützung

Attribute
dir Yes Yes Yes Yes Yes

Syntax

<element dir="ltr|rtl|auto">

Attributwerte

Value Description
ltr Default. Left-to-right text direction
rtl Right-to-left text direction
auto Let the browser figure out the text direction, based on the content (only recommended if the text direction is unknown)

Verwandte Seiten

HTML-Tutorial: HTML-Attribute

CSS-Referenz: Eigenschaft Richtung

HTML-DOM-Referenz: HTML-DOM-dir-Eigenschaft

HTML-DOM-Referenz: Stilrichtungseigenschaft