Skip to content
Tutorials Center
My learning

Topics

HTML Reference Β· Inline Text

The <rp> element

Reference for the HTML <rp> element: fallback parentheses around ruby annotations for browsers without ruby support, with examples and technical details.

The <rp> element (ruby parenthesis) holds punctuation, usually a pair of parentheses, that is shown only when a browser cannot lay out ruby annotations. Browsers that support <ruby> hide <rp> completely; others show the annotation inline, and the <rp> content keeps it readable, as in "東京(とうきょう)".

HTML
<ruby>東京<rp>(</rp><rt>とうきょう</rt><rp>)</rp></ruby>

Try it

Fallback parentheses

The second line forces every part to display: inline, which is roughly what an old browser does. The parentheses from <rp> appear and keep the reading separate from the base text.

Attributes

This element has no attributes of its own. It accepts the global attributes.

Usage notes

  • Wrap each <rt>. Put one <rp> with the opening mark before the <rt> and one with the closing mark after it.
  • Any punctuation works. Parentheses are the usual choice, but brackets or full-width parentheses (( and οΌ‰) suit Japanese and Chinese text well.
  • Text only. <rp> holds plain text; don't put elements inside it.
  • Is it still needed? Every current browser supports ruby, so <rp> mostly helps with text-only tools, feed readers, copy-and-paste and some assistive technologies that ignore ruby layout. It costs little and makes the content more robust.
  • End tag is optional. You may leave out </rp> when it is followed directly by an <rt> or another <rp>, or when it is the last thing in its parent.

Technical summary

Content categories None
Permitted content Text
Tag omission The end tag may be omitted if the <rp> is immediately followed by an <rt> or <rp> element, or if there is no more content in the parent
Permitted parents A <ruby> element, directly before or after an <rt>
Implicit ARIA role No corresponding role
DOM interface HTMLElement
Default display none

Browser support

Supported in every browser; ruby-aware browsers hide it, and the rest display its text.