From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/html/element/bdo/index.html | 122 ++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 files/zh-cn/web/html/element/bdo/index.html (limited to 'files/zh-cn/web/html/element/bdo') diff --git a/files/zh-cn/web/html/element/bdo/index.html b/files/zh-cn/web/html/element/bdo/index.html new file mode 100644 index 0000000000..6037c4b619 --- /dev/null +++ b/files/zh-cn/web/html/element/bdo/index.html @@ -0,0 +1,122 @@ +--- +title: ': 双向文本替代元素' +slug: Web/HTML/Element/bdo +translation_of: Web/HTML/Element/bdo +--- +
{{HTMLRef}}
+ +
+ +

HTML 双向文本替代元素(<bdo>)改写了文本的方向性, 使文本以不同的方向渲染呈现出来(override可以翻译很多意思,编程语言中多用覆盖,重载;这里采用了Google的整体翻译,取替代替换改写之意)

+ +
{{EmbedInteractiveExample("pages/tabbed/bdo.html", "tabbed-standard")}}
+ + + +

文本的字符是从给定方向的起始点绘制的; 各个字符的方向不受影响 (因此字符集不会向后拉, 例如).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
内容分类流式元素, 短语元素, 显式元素.
许可内容短语元素.
标记省略{{no_tag_omission}}
许可父级元素接受短语元素的任何元素
隐式ARIA角色No corresponding role
许可ARIA角色任何
DOM 接口{{domxref("HTMLElement")}}直到Gecko 1.9.2 (包括Firefox 4)为止,Firefox均为此元素实现HTMLSpanElement接口。
+ +

属性

+ +

元素属性包含全局属性

+ +
+
{{htmlattrdef("dir")}}
+
+

    在此元素内容中呈现文本的方向.可能的值是:

+ +
    +
  • ltr: 指示文本应从左到右的方向.
  • +
  • rtl: 指示文本应从右到左的方向.
  • +
+
+
+ +

示例

+ +
<!-- 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>
+
+ +

结果

+ +

{{EmbedLiveSample('Examples')}}

+ +

注意

+ +

HTML 4规范未指定此元素的事件。 它们是在XHTML中添加的。 这很可能是疏忽。

+ +

规范

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
规范状态注释
{{SpecName('HTML WHATWG', 'semantics.html#the-bdo-element', '<bdo>')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'textlevel-semantics.html#the-bdo-element', '<bdo>')}}{{Spec2('HTML5 W3C')}}
{{SpecName('HTML4.01', 'dirlang.html#h-8.2.4', '<bdo>')}}{{Spec2('HTML4.01')}}
+ +

浏览器兼容性

+ + + +

{{Compat("html.elements.bdo")}}

+ +

另参见

+ + -- cgit v1.2.3-54-g00ecf