HTML Ruby Fallback Parenthesis (
<rp>
) element
is used to provide fall-back parentheses for browsers that do not support display of ruby annotations using the
<ruby>
元素。
One
<rp>
element should enclose each of the opening and closing parentheses that wrap the
<rt>
element that contains the annotation's text.
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.
| 内容类别 | None. |
|---|---|
| 准许内容 | 文本 |
| Tag omission |
The end tag can be omitted if the element is immediately followed by an
<rt>
or another
<rp>
element, or if there is no more content in the parent element.
|
| Permitted parents |
A
<ruby>
元素。
<rp>
must be positioned immediately before or after an
<rt>
元素。
|
| Implicit ARIA role | 无对应角色 |
| Permitted ARIA roles | 任何 |
| DOM 接口 |
HTMLElement
|
此元素只包括 全局属性 .
<rp>
element is used in the case of lack of
<ruby>
element support; the
<rp>
content provides what should be displayed in order to indicate the presence of a ruby annotation, usually parentheses.
This example uses ruby annotations to display the Romaji equivalents for each character.
<ruby> 漢 <rp>(</rp><rt>Kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby>
body {
font-size: 22px;
}
The result looks like this in your browser:
The HTML above rendered by a browser without ruby support might look like this:
漢 (Kan) 字 (ji)
body {
font-size: 22px;
}
See the article about the
<ruby>
element for further examples.
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of '<rp>' in that specification. |
实时标准 | |
|
HTML5
The definition of '<rp>' in that specification. |
推荐 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
rp
|
Chrome 完整支持 5 | Edge 完整支持 79 | Firefox 完整支持 38 | IE 完整支持 5 | Opera 完整支持 15 | Safari 完整支持 5 | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes | Firefox Android 完整支持 38 | Opera Android 完整支持 14 | Safari iOS 完整支持 Yes | Samsung Internet Android 完整支持 Yes |
完整支持