Definition
The <rp>
tag is used to provide parenthesis or other content around a ruby text component where <ruby>
elements are not supported by the web browser.
Example
<p>
<ruby style="font-size: 2em"
>漢<rp>(</rp><rt>かん</rt><rp>)</rp>字<rp>(</rp><rt>じ</rt
><rp>)</rp></ruby
>
</p>
<p>
<ruby>
♥<rp>:</rp><rt>Heart</rt><rp>,</rp><rt lang="fr">Cœur</rt
><rp>.</rp> ☘<rp>:</rp><rt>Shamrock</rt><rp>,</rp
><rt lang="fr">Trèfle</rt><rp>.</rp> ✶<rp>:</rp><rt>Star</rt><rp>,</rp
><rt lang="fr">Étoile</rt><rp>.</rp>
</ruby>
</p>
漢字
♥ ☘ ✶
If there is no <ruby>
support, the result would look like this:
漢()字()
♥<: , . ☘: , . ✶: , .
Usage
- The
<rp>
opening tag is required. - The
<rp>
element only shows if the browser has<ruby>
element support. - The
<rp>
closing tag can be omitted if the<rp>
element is immediately followed by an<rt>
](https://www.thewebmaster.com/html/tags/rt/)[] or<rp>
element, or if there is no more content in the parent element. - An
<rp>
element must be a child of a<ruby>
element. It must occur either immediately before or after an<rt>
element. - You can find further examples of how to use
<ruby>
elements here.
Attributes
The <rp>
element only supports the Global Attributes.
Specification
Browser Support
Desktop
Chrome | Edge | Firefox | IE | Opera | Safari |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |
Mobile
Android Webview | Chrome Android | Firefox Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |