<rb>:Ruby 基础元素
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
<rb>
HTML 元素用于分隔 <ruby>
注释的基本文本组件,即正在注释的文本。一个 <rb>
元素应包含基础文本的每个单独的原子段。
¥The <rb>
HTML element is used to delimit the base text component of a <ruby>
annotation, i.e. the text that is being annotated. One <rb>
element should wrap each separate atomic segment of the base text.
属性
使用说明
¥Usage notes
- Ruby 注释用于显示东亚字符的发音,例如使用日语注音假名或台湾语注音字符。
<rb>
元素用于分隔 ruby 基础文本的每个片段。 - 尽管
<rb>
不是 void element,但通常只在源代码中包含每个元素的开始标记,以便 ruby 标记不那么复杂且更易于阅读。然后浏览器可以填充渲染版本中的完整元素。 - 你需要为要注释的每个基本段/
<rb>
元素包含一个<rt>
元素。
示例
使用 rb
¥Using rb
在此示例中,我们为 "汉子" 的原始字符等效项提供注释:
¥In this example, we provide an annotation for the original character equivalent of "Kanji":
<ruby>
<rb>漢</rb><rb>字 </rb><rp>(</rp><rt>kan</rt><rt>ji</rt><rp>)</rp>
</ruby>
请注意我们如何包含两个 <rb>
元素,以分隔 ruby 基础文本的两个独立部分。另一方面,注释由两个 <rt>
元素分隔。
¥Note how we've included two <rb>
elements, to delimit the two separate parts of the ruby base text. The annotation on the other hand is delimited by two <rt>
elements.
结果
¥Result
单独的注释
¥Separate annotations
请注意,我们也可以使用完全单独注释的两个基本文本部分来编写此示例。在这种情况下,我们不需要包含 <rb>
元素:
¥Note that we could also write this example with the two base text parts annotated completely separately. In this case we don't need to include <rb>
elements:
<ruby>
漢 <rp>(</rp><rt>Kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
结果
¥Result
有关更多示例,请参阅有关 <ruby>
元素的文章。
¥See the article about the <ruby>
element for further examples.
技术总结
规范
Specification |
---|
HTML Standard # rb |
浏览器兼容性
BCD tables only load in the browser