HTML Ruby Text ( <rt> ) element specifies the ruby text component of a ruby annotation, which is used to provide pronunciation, translation, or transliteration information for East Asian typography. The <rt> element must always be contained within a <ruby> 元素。

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.

See the article about the <ruby> element for more examples.

内容类别 None.
准许内容 措词内容 .
Tag omission The end tag may be omitted if the <rt> element is immediately followed by an <rt> or <rp> element, or if there is no more content in the parent element
Permitted parents A <ruby> 元素。
Implicit ARIA role 无对应角色
Permitted ARIA roles 任何
DOM 接口 HTMLElement

属性

此元素只包括 全局属性 .

范例

This simple example provides Romaji transliteration for the kanji characters within the <ruby> 元素:

<ruby>
  漢 <rt>Kan</rt>
  字 <rt>ji</rt>
</ruby>
				
body {
  font-size: 22px;
}
				

The output looks like this in your browser:

On a browser without ruby support, this example might look like this:

漢 Kan 字 ji
				
body {
  font-size: 22px;
}
				

规范

规范 状态 注释
HTML 实时标准
The definition of '<rt>' in that specification.
实时标准
HTML5
The definition of '<rt>' in that specification.
推荐

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
rt 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

图例

完整支持

完整支持

另请参阅

元数据

  • 最后修改: