<rp>:Ruby 后备括号元素

<rp> HTML 元素用于为不支持使用 <ruby> 元素显示 ruby 注释的浏览器提供备用括号。一个 <rp> 元素应将每个左括号和右括号括起来,这些括号将包含注释文本的 <rt> 元素括起来。

¥The <rp> HTML element is used to provide fall-back parentheses for browsers that do not support display of ruby annotations using the <ruby> element. One <rp> element should enclose each of the opening and closing parentheses that wrap the <rt> element that contains the annotation's text.

Try it

属性

¥Attributes

该元素仅包含 全局属性

¥This element only includes the global attributes.

使用说明

¥Usage notes

  • Ruby 注释用于显示东亚字符的发音,例如使用日语注音假名或台湾语注音字符。<rp> 元素用于缺乏 <ruby> 元素支持的情况;<rp> 内容提供了应该显示的内容,以指示 ruby 注释的存在,通常是括号。

示例

¥Examples

使用 ruby 注释

¥Using ruby annotations

此示例使用 ruby 注释来显示每个字符的 罗马字 等效项。

¥This example uses ruby annotations to display the Romaji equivalents for each character.

html
<ruby><rp>(</rp><rt>Kan</rt><rp>)</rp><rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
css
body {
  font-size: 22px;
}

结果

¥Result

有关更多示例,请参阅有关 <ruby> 元素的文章。

¥See the article about the <ruby> element for further examples.

没有红宝石支持

¥Without ruby support

如果你的浏览器不支持 ruby 注释,则结果如下所示:

¥If your browser does not support ruby annotations, the result looks like this instead:

html
漢 (Kan) 字 (ji)
css
body {
  font-size: 22px;
}

技术总结

¥Technical summary

内容类别 没有任何。
允许的内容 文本
标签遗漏 如果元素后面紧跟着 <rt> 或另一个 <rp> 元素,或者父元素中没有更多内容,则可以省略结束标记。
允许的父级 <ruby> 元素. <rp> 必须紧邻 <rt> 元素之前或之后放置。
隐式 ARIA 角色 没有对应的角色
允许的 ARIA 角色 任何
DOM 接口 HTMLElement

规范

Specification
HTML Standard
# the-rp-element

¥Specifications

浏览器兼容性

BCD tables only load in the browser

¥Browser compatibility

也可以看看

¥See also