非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
HTML Ruby 基 (
<rb>
) 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.
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. |
|---|---|
| 准许内容 |
As a child of a
<ruby>
元素。
|
| Tag omission |
The end tag can be omitted if the element is immediately followed by an
<rt>
,
<rtc>
,或
<rp>
element or another
<rb>
element, or if there is no more content in the parent element.
|
| Permitted parents |
A
<ruby>
元素。
|
| Permitted ARIA roles | 任何 |
| DOM 接口 |
HTMLElement
|
此元素只包括 全局属性 .
<rb>
element is used to separate out each segment of the ruby base text.
<rb>
is not an empty element, it is common to just include the opening tag of each element in the source code, so that the ruby markup is less complex and easier to read. The browser can then fill in the full element in the rendered version.
<rt>
element for each base segment/
<rb>
element that you want to annotate.
In this example, we provide an annotation for the original character equivalent of "Kanji":
<ruby> <rb>漢<rb>字 <rp>(</rp><rt>kan<rt>ji<rp>)</rp> </ruby>
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>
元素。
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>
元素:
<ruby> 漢 <rp>(</rp><rt>Kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby>
<ruby> <rb>漢<rb>字 <rp>(</rp><rt>kan<rt>ji<rp>)</rp> </ruby>
body {
font-size: 22px;
}
The output looks like so:
The HTML above might look something like this when rendered by a browser without ruby support:
漢字 (kan ji)
body {
font-size: 22px;
}
注意
: See the article about the
<ruby>
element for further examples.
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML5
The definition of '<rb>' in that specification. |
推荐 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
rb
非标
|
Chrome
部分支持
5
注意事项
|
Edge
部分支持
79
注意事项
|
Firefox 完整支持 38 | IE 完整支持 5 |
Opera
部分支持
15
注意事项
|
Safari
部分支持
5
注意事项
|
WebView Android
部分支持
37
注意事项
|
Chrome Android
部分支持
18
注意事项
|
Firefox Android 完整支持 38 |
Opera Android
部分支持
14
注意事项
|
Safari iOS
部分支持
Partial
注意事项
|
Samsung Internet Android
部分支持
Partial
注意事项
|
完整支持
部分支持
非标。预期跨浏览器支持较差。
见实现注意事项。