👀 Live Preview
Styled ruby with rt annotations for 日本語:
本語

The <rt> tag defines ruby text annotations for East Asian characters. This guide covers syntax with ruby, pronunciation and meaning use cases, styling, browser support, and best practices for beginners.
Annotation role.
Required parent.
Reading hints.
Translation aids.
Fallback support.
Semantic markup.
<rt> Tag?The <rt> tag is an HTML element used to define the text that should be displayed as ruby annotations. Ruby annotations are small notes typically shown above or beside East Asian characters to provide pronunciation or meaning information.
Pair rt with ruby for semantic annotation markup. Add optional rp for fallback parentheses.
Use rt in language-learning sites, manga readers, dictionaries, and any page that helps readers understand Japanese, Chinese, or Korean characters.
Pair rt with the ruby element. Each rt follows the base character it annotates:
<ruby>
漢 <rt>kan</rt>
字 <rt>ji</rt>
</ruby>rt inside a ruby element.rt immediately after its base character or character group.rb.rp around rt for graceful fallback in older browsers.| Topic | Code Snippet | Notes |
|---|---|---|
| Single character | 漢<rt>kan</rt> | Inside ruby |
| Multiple chars | 本<rt>hon</rt>語<rt>go</rt> | One rt per base |
| Parent element | <ruby> | Required wrapper |
| Fallback | <rp>(</rp> | Optional with rt |
| Styling | class on ruby | Not on rt |
| Browser support | Modern full | IE 10+ partial |
<rt> vs <rp>| Element | Role | Contains |
|---|---|---|
<rt> | Ruby annotation text | Pronunciation or meaning |
<rp> | Fallback parentheses | ( and ) punctuation |
<ruby> | Annotation container | Base text + rt + rp |
The <rt> tag does not have specific attributes. It is commonly used inside ruby, which supports global attributes such as class and style for customization.
<ruby class="ruby-text" style="font-size: 1.2em;">
本<rt>hon</rt>
語<rt>go</rt>
</ruby>— None on rtrt has no tag-specific attributes. Only global HTML attributes apply.
<rt>kan</rt>class On rubyStyle the annotation group via the parent ruby element.
class="ruby-text"style On rubyAdjust font size or color on ruby; use CSS for rt sizing.
style="font-size: 1.2em"Use rt inside ruby for pronunciation guides and meaning annotations.
Styled ruby with rt annotations for 日本語:
本語
The <rt> tag provides pronunciation guidance and meaning annotations for East Asian characters inside ruby elements.
The primary purpose of rt is to offer pronunciation guidance for characters.
<ruby>
音<rt>on</rt>
楽<rt>gaku</rt>
</ruby>You can use rt to provide additional meaning annotations to characters.
<ruby>
科<rt>science</rt>
学<rt>study</rt>
</ruby>rt gives assistive technology a clear annotation role.ruby element.Each base character is followed by its rt annotation inside ruby.
Ruby-capable user agents render rt as smaller text above the base.
When ruby layout fails, rp shows parentheses around rt text.
Learners see pronunciation or meaning hints directly beside characters.
The <rt> tag is supported in all modern browsers. Internet Explorer 10 and later has partial ruby support.
Chrome, Firefox, Safari, Edge, and Opera render <rt> annotations inside <ruby> correctly.
Bottom line: Use <rt> inside ruby for East Asian annotation markup in any modern browser.
Mastery of the <rt> tag is essential for web developers aiming to enhance the presentation of ruby text. Implementing this tag effectively ensures that pronunciation and meaning annotations are displayed accurately, contributing to a richer user experience.
rt inside ruby elementsrp for fallback readabilityruby elementrt outside a ruby contextrbrtclass on rt is the primary styling hook<rt>Bookmark these before you annotate East Asian text.
Annotation role.
PurposeRequired parent.
StructureReading hints.
Use caseTranslation aids.
Use caseNot rt attrs.
CSSModern browsers.
Compatibilityruby element, immediately after each base character it annotates.class and style on the parent ruby element.Practice <rt> for pronunciation and meaning inside ruby in the Try It editor.
6 people found this page helpful