<rp>

The HTML <rp> element offers parentheses or alternative text for browsers lacking support for ruby annotations. It is used in conjunction with <ruby>, <rt>, and <rb> to enhance the presentation of ruby text.

<rp> Tag

The <rp> element in HTML provides fallback text, typically parentheses, for ruby annotations when a browser does not support the <ruby> element. It ensures that pronunciation guides or explanations remain readable.

Syntax

index.html
<ruby>
  Base Text
  <rt>Annotation</rt>
  <rp>(</rp>
  <rp>)</rp>
</ruby>

rp Demo

Example with ruby text: 漢字Kanji(Kanji (fallback)).

index.html
<p>
  Example with ruby text: <ruby>漢字<rt>Kanji</rt><rp>(</rp><rtc>Kanji (fallback)</rtc><rp>)</rp></ruby>.
</p>

Definition and Usage

The <rp> tag is used within <ruby> to provide readable fallback content for browsers that do not support ruby annotations.

  • The <ruby> tag wraps text that requires annotation.
  • The <rt> element supplies pronunciation or explanation.
  • The <rp> tag ensures clarity by adding visible characters, such as parentheses, in unsupported browsers.

Attributes

This element supports global attributes.

  • <ruby> – Defines ruby annotation.
  • <rt> – Specifies the annotation text.
  • <rb> – Marks the base text in a ruby annotation.
  • <rtc> – Groups multiple annotations.

Conclusion

The <rp> tag plays a vital role in enhancing accessibility by ensuring that ruby annotations remain understandable, even when browser support is lacking. It works alongside <ruby> and <rt> to improve text presentation, particularly for languages requiring pronunciation guides or clarifications.