Skip to content
Tutorials Center
My learning

Topics

HTML Reference ยท Inline Text

The <rt> element

Reference for the HTML <rt> element: the small annotation text inside <ruby>, such as a reading or gloss, with examples, tag omission rules and technical details.

The <rt> element (ruby text) holds the annotation in a <ruby> element: the small reading, transliteration or gloss that belongs to the base text just before it. It only has meaning inside <ruby>; on its own it is not valid.

HTML
<ruby>็Œซ<rt>ใญใ“</rt></ruby>

Try it

Ruby text annotations

You can style <rt> like any element. Here it is colored, and ruby-position: under on the parent moves the second annotation below the base.

Attributes

This element has no attributes of its own. It accepts the global attributes.

Usage notes

  • Order matters. Each <rt> annotates the base text that comes right before it inside the same <ruby>. Write the base first, then its <rt>.
  • Per-character or per-word. Put one <rt> after each character to annotate them separately, or one <rt> after a whole word to annotate it as a unit.
  • End tag is optional. You may leave out </rt> when it is followed directly by another <rt> or an <rp>, or when it is the last thing in its parent. Writing it out is clearer and is the style used on this site.
  • Fallback. Browsers without ruby support show the annotation inline right after the base. Add <rp> parentheses so that fallback reads naturally.
  • Font size. Browsers shrink ruby text to about half size. If you raise it with CSS, keep it clearly smaller than the base so readers can tell the two apart.

Technical summary

Content categories None
Permitted content Phrasing content
Tag omission The end tag may be omitted if the <rt> is immediately followed by an <rt> or <rp> element, or if there is no more content in the parent
Permitted parents A <ruby> element
Implicit ARIA role No corresponding role
DOM interface HTMLElement
Default display ruby-text

Browser support

Supported in all current browsers.