HTML dirคุณสมบัติ
ตัวอย่าง
ย่อหน้าที่มีทิศทางจากขวาไปซ้าย:
<p dir="rtl">Write this text right-to-left!</p>
ความหมายและการใช้งาน
แอตทริบิวต์dir
ระบุทิศทางข้อความของเนื้อหาขององค์ประกอบ
รองรับเบราว์เซอร์
Attribute | |||||
---|---|---|---|---|---|
dir | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
<element dir="ltr|rtl|auto">
ค่าแอตทริบิวต์
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) |
หน้าที่เกี่ยวข้อง
บทช่วยสอน HTML: แอตทริบิวต์ HTML
การอ้างอิง CSS: คุณสมบัติทิศทาง
การอ้างอิง HTML DOM: HTML DOM dir คุณสมบัติ
การอ้างอิง HTML DOM: คุณสมบัติทิศทางสไตล์