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/rb/index.html | 141 +++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 files/zh-cn/web/html/element/rb/index.html (limited to 'files/zh-cn/web/html/element/rb') diff --git a/files/zh-cn/web/html/element/rb/index.html b/files/zh-cn/web/html/element/rb/index.html new file mode 100644 index 0000000000..b3404088d5 --- /dev/null +++ b/files/zh-cn/web/html/element/rb/index.html @@ -0,0 +1,141 @@ +--- +title: ': The Ruby Base element' +slug: Web/HTML/Element/rb +translation_of: Web/HTML/Element/rb +--- +
{{HTMLRef}}
+ +

HTML Ruby Base<rb>)元素用于分隔{{HTMLElement("ruby")}}注释的基本文本组件(即正在注释的文本)。一个<rb>元素应该包装基本文本的每个单独的原子段。

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
内容范畴
允许内容作为 {{htmlelement("ruby")}} 元素的子元素。
标签省略如果元素紧跟{{HTMLElement("rt")}}、{{HTMLElement("rtc")}}或{{HTMLElement("rp")}}元素或其他元素,则可省略结束标记 <rb>元素,或者如果父元素中没有其他内容。
允许的父元素{{HTMLElement("ruby")}}元素。
允许的 ARIA 角色任意
DOM 接口{{domxref("HTMLElement")}}
+ +

属性

+ +

这个元素仅仅支持 全局属性

+ +

用法注解

+ + + +

示例

+ +

在此示例中,我们提供了与“hanzi”等效的原始字符的注释:

+ +
<ruby>
+  <rb>漢</rb>字
+  <rp>(</rp><rt>han</rt>zi<rp>)</rp>
+</ruby>
+ +

请注意我们如何包含两个<rb>元素,以分隔ruby基本文本的两个独立部分。 另一方面,注释由两个{{htmlelement("rt")}}元素分隔。

+ +

请注意,我们也可以使用完全单独注释的两个基本文本部分来编写此示例。 在这种情况下,我们不需要包含<rb>元素:

+ +
<ruby>
+  漢 <rp>(</rp><rt>han</rt><rp>)</rp>
+  字 <rp>(</rp><rt>zi</rt><rp>)</rp>
+</ruby>
+ + + +

输出看起来像这样:

+ +

{{EmbedLiveSample("with-ruby", "100%", 60)}}

+ +

当在不支持ruby的浏览器中呈现时,上面的HTML可能看起来像这样:

+ +
+ +
+ +

{{EmbedLiveSample("without-ruby", "100%", 60)}}

+ +
+

提示: 有关更多示例,请参阅有关{{HTMLElement("ruby")}}元素的文章。

+
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-rb-element', '<rb>')}}{{Spec2('HTML5 W3C')}}
+ +

浏览器兼容性

+ + + +

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

+ +

另见

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