此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

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 2017年3月.

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

一个字符串。

规范

Specification
HTML
# dom-document-dir

浏览器兼容性

参见

  • dir 全局属性