Text Content

HTML <ruby> element

Associates base text with short annotations, commonly pronunciation or reading guides in East Asian typography. Use rt for each annotation and optional rp for fallback parentheses. Ruby layout is not a generic tooltip or replacement for full accessible explanations. It accepts global HTML attributes; individual global features may be inapplicable or restricted.

Formal Syntax & Structure

html syntaxhtml
<ruby>  Base  <rt>Annotation</rt></ruby>

Return Value

HTMLElement

Content model: Phrasing content arranged with ruby annotations; use rt and optional rp according to ruby markup rules.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>HTML example</title>  </head>  <body>    <ruby>      漢      <rt>kan</rt>      字      <rt>ji</rt>    </ruby>  </body></html>
HTML Reference