The HTML <rb> element delimits the base text component of a <ruby> annotation. Ruby annotations are usually used in East Asian typography. They display the pronunciation of East Asian characters. The <rb> tag is used to separate each segment of the base text.
You must include a <rt> tag for each base element that must be annotated.
Although the <rb> element isn’t an empty element, it is normal to use in the source code only the opening tag of each element, making it easier to read. In the rendered element, the browser can then fill in the full element.
The <rb> tag is one of the HTML5 elements.
Syntax
The <rb> tag comes in pairs. The content is written between the opening (<rb>) and closing (</rb>) tags. The closing tag of the <rb> element may be omitted when <rb> is immediately followed by <rb>, <rt>, <rp> or <rtc>, or when there isn’t any content in the parent element.
Example of the HTML <rb> tag:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
body {
font-size: 30px;
}
</style>
</head>
<body>
<ruby>
<rb>漢</rb>
<rb>字</rb>
<rp>(</rp><rt>kan<rt>ji<rp>)</rp>
</ruby>
</body>
</html>
Result
The <rb> tag supports the Global Attributes and Event Attributes.
Browser support
5.0+ | ✕ | 38.0+ | 5.0+ | 15.0+ |
Practice Your Knowledge
Quiz Time: Test Your Skills!
Ready to challenge what you've learned? Dive into our interactive quizzes for a deeper understanding and a fun way to reinforce your knowledge.