HTML <ruby> element represents small annotations that are rendered above, below, or next to base text, usually used for showing the pronunciation of East Asian characters. It can also be used for annotating other kinds of text, but this usage is less common.

术语 ruby originated as a unit of measurement used by typesetters , representing the smallest size that text can be printed on newsprint while remaining legible.

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.

内容类别 流内容 , 措词内容 ,可触及内容。
准许内容 措词内容 .
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts 措词内容 .
Implicit ARIA role 无对应角色
Permitted ARIA roles 任何
DOM 接口 HTMLElement

属性

此元素只包括 全局属性 .

范例

Example 1: Character

<ruby>
  漢 <rp>(</rp><rt>Kan</rt><rp>)</rp>
  字 <rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
					

Example 2: Word

<ruby>
  明日 <rp>(</rp><rt>Ashita</rt><rp>)</rp>
</ruby>
					

规范

规范 状态 注释
HTML 实时标准
The definition of '<ruby>' in that specification.
实时标准
HTML5
The definition of '<ruby>' 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
ruby Chrome 完整支持 5 Edge 完整支持 12 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

图例

完整支持

完整支持

另请参阅

元数据

  • 最后修改: