Atribut dir HTML


Contoh

Paragraf dengan arah kanan-ke-kiri:

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

Definisi dan Penggunaan

Atribut dirmenentukan arah teks dari konten elemen.


Dukungan Peramban

Attribute
dir Yes Yes Yes Yes Yes

Sintaksis

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

Nilai Atribut

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)

Halaman Terkait

Tutorial HTML: Atribut HTML

Referensi CSS: properti arah

Referensi DOM HTML: Properti dir HTML DOM

Referensi DOM HTML: Properti arah gaya