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>Report a problem with this exampleOpens a pre-filled issue on GitHub.