rt
Specifies the ruby text (annotation) in a ruby annotation.
Description
The <rt> element specifies the ruby text component of a ruby annotation. This is the small text that appears above (or beside) the base text to provide pronunciation or other annotation. It must be contained within a <ruby> element.
Basic Example
With Fallback Parentheses
Use <rp> elements to provide fallback parentheses for browsers that don't support ruby:
Individual Character Annotations
Each character can have its own ruby text:
Pinyin Annotations
Ruby text is also used for Chinese pinyin:
Styling Ruby Text
The <rt> element can be styled with CSS:
Common styling adjustments include font size, color, and position.
Attributes
This element supports global attributes.
Accessibility
Screen readers handle ruby text differently. Some may read the base text followed by the ruby text, others may skip the ruby text or provide options for users to hear it. The ruby text is valuable for language learners and those who need pronunciation assistance.