HTML <rb> Element

The <rb> element was used inside a <ruby> element to identify the base text being annotated. It could separate individual characters or groups of characters so they could be associated with ruby annotation text, such as pronunciation information.

Historical Syntax

HTML using the <rb> element could contain markup similar to the following:

<ruby>
  <rb>漢</rb>
  <rt>かん</rt>
</ruby>

The <rb> element identified the base character being annotated, while <rt> supplied the ruby text associated with it. This code is shown for historical reference only and should not be used in new HTML.

Attributes

The <rb> element did not have any element-specific attributes. Its purpose came from its position inside a <ruby> element and the base text it contained.

Historical Use

Ruby annotations are small annotations displayed alongside base text and are commonly used to provide pronunciation or other information for East Asian writing. The <rb> element explicitly marked the portion of base text associated with a ruby annotation.

For more complex annotations, multiple <rb> elements could divide the base text into separate segments, with corresponding ruby text used to annotate those segments.

The element therefore acted primarily as a wrapper around the base characters. It did not itself create the annotation; the annotation text was supplied by elements such as <rt>.

Why It Became Obsolete

The <rb> element became unnecessary because modern ruby markup can place the base text directly inside the <ruby> element. A separate element is not required merely to identify that text as the ruby base.

For annotations that require more complex relationships between base text and annotation text, nested <ruby> elements can be used. This allows modern HTML to represent ruby annotations without the additional <rb> wrapper.

The WHATWG HTML Living Standard therefore classifies <rb> as an entirely obsolete, non-conforming element. :contentReference[oaicite:0]{index=0}

Modern Alternative

Place the base text directly inside the <ruby> element and use <rt> for the annotation:

<ruby>
  漢
  <rt>かん</rt>
</ruby>

The character is the base text, while the text inside <rt> supplies its pronunciation. The browser can position the ruby annotation appropriately without an <rb> wrapper.

When separate portions of the base text need their own annotations, individual or nested <ruby> elements can be used instead. :contentReference[oaicite:1]{index=1}

Play in Editor

Legacy Browser Support

The <rb> element has been implemented by browsers and may still be recognized for compatibility with existing content. However, browser recognition does not make the element conforming modern HTML, and it should not be used in new webpages.

Existing <rb> markup should be updated by placing the ruby base text directly inside <ruby> or by restructuring more complex annotations with nested <ruby> elements. MDN currently marks <rb> as deprecated. :contentReference[oaicite:2]{index=2}

The <ruby> element represents a ruby annotation, while the <rt> element contains the annotation text. The <rp> element can provide fallback parentheses for user agents that do not display ruby annotations. :contentReference[oaicite:3]{index=3}

Specifications

The <rb> element is listed as an entirely obsolete, non-conforming feature in the WHATWG HTML Living Standard . The specification recommends placing the ruby base directly inside <ruby> or using nested <ruby> elements instead. :contentReference[oaicite:4]{index=4}