Ruby markup associates a short annotation with the text it explains, commonly for pronunciation.
HTML ruby: attach short pronunciation notes to text
When the element earns its place
A bilingual archive displays a name in Japanese script while a small reading helps reviewers who know the spoken name but not the characters. Keep the base text in the document. The annotation supplements it; it is not a translated replacement. The fallback parentheses matter when a reader cannot present ruby annotations as intended. For an extended explanation or a full translation, use surrounding prose instead.
<p>File owner: <ruby>山田<rp>(</rp><rt>やまだ</rt><rp>)</rp></ruby>.</p>
<p>The surname is read Yamada in this record.</p>Behavior boundary
Ruby does not supply a language translation or verify a person's preferred reading. Confirm names against the record and set document or span language appropriately when this appears inside a multilingual page.
Cost and operational limits
The markup adds a few nodes per annotated term. Large catalogs with annotation on every word grow the DOM and become difficult to read, so reserve it for text where the short reading helps.
Common Mistakes
- Do not replace the base characters with only the annotation.
- Do not use ruby as a tooltip for paragraphs of commentary.
- Do not guess a person's name reading from spelling alone.
