<rp> Tag in HTML | Ruby Annotation

The <rp> tag in HTML is used to provide fallback text for browsers that do not support ruby annotations. Ruby annotations are used to show pronunciation guides or annotations next to text, primarily in East Asian languages.

Key Points on <rp> Tag:

Syntax of <rp> Tag:

Syntax Example

<ruby>Main Text<rp>Fallback Text</rp></ruby>

Example of <rp> Tag in HTML:

This example demonstrates the usage of the <rp> tag within a <ruby> element for a fallback display.

Code Example

<!DOCTYPE html>
        <html lang="en">
        <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>HTML <rp> Tag Example</title>
        </head>
        <body>
            <h1>HTML <rp> Tag Example</h1>
            <p>
                <ruby>漢字<rp>(Kanji)</rp></ruby>
            </p>
        </body>
        </html>

Output

HTML Tag Example

漢字(Kanji)

The <rp> tag is used as a fallback for the <ruby> tag when a browser does not support ruby annotations. It ensures that even in the absence of ruby annotations, users can see alternative text that describes the meaning or pronunciation of the main text.