HTML Bidirectional Text Override element ( <bdo> ) overrides the current directionality of text, so that the text within is rendered in a different direction.

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

The text's characters are drawn from the starting point in the given direction; the individual characters' orientation is not affected (so characters don't get drawn backward, for example).

内容类别 流内容 , 措词内容 ,可触及内容。
准许内容 措词内容 .
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts 措词内容 .
Implicit ARIA role 无对应角色
Permitted ARIA roles 任何
DOM 接口 HTMLElement Up to Gecko 1.9.2 (Firefox 4) inclusive, Firefox implements the HTMLSpanElement interface for this element.

属性

This element's attributes include the 全局属性 .

dir
The direction in which text should be rendered in this element's contents. Possible values are:
  • ltr : Indicates that the text should go in a left-to-right direction.
  • rtl : Indicates that the text should go in a right-to-left direction.

范例

<!-- Switch text direction -->
<p>This text will go left to right.</p>
<p><bdo dir="rtl">This text will go right
to left.</bdo></p>
				

结果

注意事项

The HTML 4 specification did not specify events for this element; they were added in XHTML. This is most likely an oversight.

规范

规范 状态 注释
HTML 实时标准
The definition of '<bdo>' in that specification.
实时标准
HTML5
The definition of '<bdo>' in that specification.
推荐
HTML 4.01 Specification
The definition of '<bdo>' in that specification.
推荐

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
bdo Chrome 完整支持 Yes Edge 完整支持 12 Firefox 完整支持 Yes IE 完整支持 Yes Opera 完整支持 Yes Safari 完整支持 Yes WebView Android 完整支持 Yes Chrome Android 完整支持 Yes Firefox Android 完整支持 Yes Opera Android 完整支持 Yes Safari iOS 完整支持 Yes Samsung Internet Android 完整支持 Yes

图例

完整支持

完整支持

另请参阅

元数据

  • 最后修改: