Skip to main content

HTML <rp> Tag

The HTML <rp> tag is an element used to provide fallback text in the case of browsers not supporting the ruby annotation. It allows developers to create annotations or furigana for CJK (Chinese, Japanese and Korean) languages. This can be a useful tool for providing pronunciation guidance for unfamiliar words and also for inserting specific characters.

To illustrate its use, we can look at one simple example:

<ruby>
    你<rp>(</rp><rt>nǐ</rt><rp>)</rp>
</ruby>

This code will display the character , with the pronunciation of appearing as a tooltip when hovering over it

Another example using ruby annotation can be seen here:

(fāng) 便(biàn)(miàn)
<ruby>
    方<rp>(</rp><rt>fāng</rt><rp>)</rp>
    便<rp>(</rp><rt>biàn</rt><rp>)</rp>
    面<rp>(</rp><rt>miàn</rt><rp>)</rp>
</ruby>

The three characters 方便面, along with their individual pronunciations with respect to Mandarin, are displayed by this code snippet.