HTML <rt> Element
The HTML <rt> element provides pronunciation, translation, or other explanatory text for the characters represented by a ruby annotation.
Syntax
<ruby>
漢 <rt>かん</rt>
</ruby>
The <rt> element is used inside a <ruby> element. The text inside <rt> provides an annotation for the associated base text, and supporting browsers normally display it above or beside the characters.
Attributes
The <rt> element supports the global HTML attributes. It does not have any element-specific attributes.
Example
This example uses the <rt> element to provide the pronunciation of Japanese kanji characters.
Usage Notes
The <rt> element is used as part of a ruby annotation, which is commonly used with East Asian writing to provide pronunciation guides or short explanatory annotations.
The characters being annotated are placed directly inside the <ruby> element, while the corresponding pronunciation or explanation is placed inside an <rt> element.
Browsers that support ruby formatting normally display the annotation in smaller text above or beside the base characters, depending on the writing direction and browser layout.
An <rt> element should contain the annotation itself. Optional <rp> elements can be added around it to provide fallback punctuation for browsers that do not properly display ruby annotations.
Accessibility
Ruby annotations can make unfamiliar characters easier to understand by providing pronunciation or explanatory information directly with the text they describe.
Keep each annotation clearly associated with the appropriate base text and make the <rt> content concise. The annotation should supplement the base text rather than contain unrelated information.
Browser Support
Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.
For detailed browser compatibility information, see Can I Use: HTML <rt> Element .
Related Elements
The <rt> element is closely related to the <ruby> element that contains the complete ruby annotation and the <rp> element that provides optional fallback punctuation.
