<rp>
<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
<ruby>
Base Text
<rt>Annotation</rt>
<rp>(</rp>
<rp>)</rp>
</ruby>
rp Demo
Example with ruby text: 漢字.
<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.
Related Elements
<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.
<rb>
The HTML <rb> element defines the base text for a ruby annotation, working with <rt> and <rp> to offer pronunciation or supplementary information for East Asian scripts.
<rt>
The HTML <rt> element defines the ruby text or pronunciation for a <ruby> annotation, offering additional context to assist with reading East Asian characters.