<rt>:Ruby 文本元素

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

<rt> HTML 元素用於指定 ruby 注釋的 ruby 文本部分,用於為東亞排版提供發音、翻譯或音譯信息。<rt> 元素必須始終包含在一個 <ruby> 元素中。

嘗試一下

請參見 <ruby> 元素的文章以獲取更多範例。

屬性

該元素僅包含全域屬性

範例

使用 ruby 注釋

此簡單範例為 <ruby> 元素中的漢字字符提供了羅馬字音譯:

html
<ruby><rt>Kan</rt><rt>ji</rt> </ruby>

結果

技術摘要

內容分類
允許的內容 段落型內容
標籤省略 如果 <rt> 元素後面緊跟著一個 <rt><rp> 元素,或者後面沒有更多的內容,則結束標籤可以省略。
允許的父元素 一個 <ruby> 元素。
隱含 ARIA 角色 沒對應的角色
允許的 ARIA 角色 任何
DOM 介面 HTMLElement

規範

Specification
HTML
# the-rt-element

瀏覽器相容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
rt

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

參見