HTML4 HTML5
The <ruby> tag serves as a container for phonetic or explanatory annotations (so-called Ruby annotations)[cite: 3]. It connects the main text and its tip together, which displays above or beside it (usually via the <rt> tag)[cite: 3].
It is most commonly used in Asian languages (e.g., Japanese, Chinese, or Korean) to indicate correct pronunciation for complex characters, but can also be used to add short explanations in any other language[cite: 3].
Both opening and closing tags are mandatory[cite: 3].
Attributes:
class, id, and style are used[cite: 3].In the example below, the <ruby> container groups character 日 with pronunciation ni and character 本 with pronunciation hon[cite: 3]:
Code:
The browser will interpret this code as follows:
Japan's name in kanji: 日 本