Ruby Text Annotations
Uses ruby, rt, and rp elements to add pronunciation guides and annotations above East Asian characters, with fallback support.
Code
<p>
<ruby>
漢<rt>kan</rt>
字<rt>ji</rt>
</ruby>
means Chinese characters in Japanese.
</p>
<p>
<ruby>
東<rt>tokyo</rt>
京<rt>kyoto</rt>
</ruby>
are two major cities in Japan.
</p>
<p>
<ruby>
香<rt>xiāng</rt>
</ruby>
means fragrance in Chinese.
</p>
<p>
<ruby>
韓<rt>han</rt>
國<rt>guk</rt>
</ruby>
means Korea in Korean.
</p>
<p>
<ruby>
文<rt><rp>(</rp>wén<rp>)</rp></rt>
字<rt><rp>(</rp>zì<rp>)</rp></rt>
</ruby>
with fallback parentheses.
</p>
<style>
ruby {
ruby-position: over;
font-size: 1.5em;
}
rt {
font-size: 0.5em;
color: #666;
font-weight: normal;
}
ruby {
margin: 0 0.2em;
}
</style>How the snippet works
<ruby> attaches pronunciation annotations above base text, with rt carrying the annotation.
Key statements
漢<rt>kan</rt>
字<rt>ji</rt>
東<rt>tokyo</rt>
Interactive Tools for This Topic
JSON to Zod Schema ConverterInfer typed Zod z.object schemas from JSON payloads locally, supporting nested objects, merged array shapes, enums, nullable fields, and JSDoc comments.JSON Schema ValidatorValidate JSON data against a JSON Schema definition and get detailed error reports. Supports type checking, required fields, and common constraint validation.JSONL / NDJSON InspectorValidate NDJSON and JSON Lines line-by-line, pinpoint syntax errors by line number, analyze key frequencies and types, and export a pretty JSON array.Credit Card Brand DetectorIdentify the card network from a number's prefix and length, validate the Luhn checksum, and show a masked form and the issuer identification number.
FAQ
- Which non-generic elements does the markup use?
- `<p>`, `<ruby>`, `<rt>`, `<rp>` — each carries native semantics (or a browser behavior) that generic containers do not.
Report a problem with this exampleOpens a pre-filled issue on GitHub.