HTMLディレクトリ属性


右から左の方向の段落:

<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 DOMdirプロパティ

HTML DOMリファレンス:スタイル方向プロパティ