👀 Live Preview
Basic ruby annotation with rp fallback:
漢

The <rp> tag provides fallback parentheses in ruby annotations for East Asian typography. This guide covers syntax, use with ruby and rt, browser support, and best practices for beginners.
Parentheses role.
With rt element.
Before and after rt.
Ruby-capable UAs.
Reading aids.
Graceful fallback.
<rp> Tag?The <rp> tag is an HTML element designed to provide fallback parentheses for browsers that do not support the display of ruby annotations. It is used inside the <ruby> element, wrapping punctuation around <rt> (ruby text) so non-supporting browsers still show readable annotations.
When ruby layout works, browsers hide rp and show rt above the base characters. When it does not, users see something like 漢(kan).
Use rp together with ruby and rt for pronunciation or translation hints in Japanese, Chinese, Korean, and other East Asian content.
Place rp before and after rt to supply fallback parentheses:
<ruby>
漢 <rp>(</rp><rt>kan</rt><rp>)</rp>
</ruby>rp and rt inside a ruby element.rp for the opening parenthesis and one for the closing parenthesis.rt — rp only holds fallback punctuation.rb or rtc in new documents.| Topic | Code Snippet | Notes |
|---|---|---|
| Basic pattern | <rp>(</rp><rt>...</rt><rp>)</rp> | Inside ruby |
| Parent element | <ruby> | Required wrapper |
| Annotation text | <rt> | Reading hint |
| Attributes | None | Global only |
| Ruby-capable UA | rp hidden | rt shown above |
| Browser support | Modern full | IE 10+ partial |
<rp> vs <rt>| Element | Role | Visible when ruby works? |
|---|---|---|
<rp> | Fallback parentheses | No (hidden) |
<rt> | Annotation text | Yes (above base) |
<ruby> | Container for both | Yes |
The <rp> tag does not support any specific attributes. Its primary function is to act as a container for fallback parentheses.
— NoneNo tag-specific attributes. Only global HTML attributes such as class apply.
<rp>(</rp>class CSSOptional styling when customizing fallback display.
class="ruby-fallback"Wrap rt annotations with rp fallback parentheses inside ruby elements.
Basic ruby annotation with rp fallback:
漢
The <rp> tag is used within ruby annotations to provide a text fallback for browsers that do not support ruby layout.
The primary use of rp is within ruby annotations to provide fallback parentheses around rt text.
<ruby>
漢 <rp>(</rp><rt>kan</rt><rp>)</rp>
</ruby>Multi-character base text with rt and rp for place names or vocabulary.
<ruby>
東京 <rp>(</rp><rt>とうきょう</rt><rp>)</rp>
</ruby>lang="ja" or the correct language on the page or element.rp alone outside a ruby context.Opening and closing rp elements wrap the rt annotation.
The user agent displays rt above the base characters.
Users without ruby support see base(rt) inline text.
Ruby annotations stay accessible whether or not layout is supported.
The <rp> tag is supported in all modern browsers. Internet Explorer 10 and later has partial ruby support.
Modern browsers hide <rp> and render <rt> annotations correctly inside <ruby>.
Bottom line: Use <rp> with ruby and rt for reliable ruby annotation fallbacks.
The <rp> tag might seem subtle, but its role in providing fallback parentheses within ruby annotations is significant. Incorporating this tag into your HTML markup ensures a consistent and accessible presentation of ruby text across various browsers.
rp with ruby and rtlang for East Asian contentrp outside a ruby elementrp instead of rtrt when adding rprb or rtc wrappers<rp>Bookmark these before you add ruby annotations.
Parentheses role.
PurposeRequired parent.
StructureBefore and after.
SyntaxWhen ruby works.
BehaviorReading aids.
ContextModern browsers.
Compatibilityrt text when ruby layout is not supported.rt, typically as <rp>(</rp><rt>...</rt><rp>)</rp>.rp and display rt above the base text.Practice <rp> with ruby and rt in the Try It editor.
6 people found this page helpful