Document:dir 属性

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Document.dir 属性是一个表示文档的文本方向(即从左至右(默认)或从右至左)的字符串。可能的值包括 'rtl'(从右至左)和 'ltr'(从左至右)。

一个字符串。

规范

Specification
HTML
# dom-document-dir

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
dir

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
See implementation notes.
Has more compatibility info.

参见

  • dir 全局属性