CKTIS / HTML
ruby — short text annotations
The `ruby` element associates base text with a short annotation, such as a pronunciation guide for Japanese characters.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<ruby>base text<rp>(</rp><rt>annotation</rt><rp>)</rp></ruby>ruby marks base text together with annotations, often used in East Asian typography. rt contains the annotation; optional rp elements surround it with fallback characters for browsers without ruby support. They are not part of the annotation.
Use ruby where phrasing content is allowed. Follow base text with rt; these pairs can repeat. Both opening and closing ruby tags are required. The element supports global attributes. Its purpose is to mark the relationship between text and an annotation, not merely to reduce the font size.
Examples
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Ruby</title>
</head>
<body>
<p><ruby>漢字<rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby></p>
</body>
</html>Result
Base: 漢字; annotation: かんじ; fallback: 漢字(かんじ).
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.