HTML5 <ruby>
Tag
Topic: HTML5 Tags ReferencePrev|Next
Description
The <ruby>
element represents a ruby annotation. Ruby annotations are used for showing pronounciation of East Asian characters, like Chinese and Japanese Chinese.
The <ruby>
element is used with the <rt>
element to create annotations or pronunciation guides for words and phrases. The base text should be enclosed in a <ruby>
tag; the annotation, enclosed in an <rt>
tag, will appear as smaller text above the base text.
The optional <rp>
element can be used to wrap parentheses around the ruby text to indicate the presence of a ruby annotation for browsers that do not support this formatting. The following table summarizes the usages context and the version history of this tag.
Placement: | Inline |
---|---|
Content: | Inline, and text |
Start/End Tag: | Start tag: required, End tag: required |
Version: | New in HTML5 |
Syntax
The basic syntax of the <ruby>
tag is given with:
The example below shows the <ruby>
tag in action.
Example
Try this code »<ruby>
漢 <rp>(</rp><rt>Kan</rt><rp>)</rp>
字 <rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
Tag-Specific Attributes
The <ruby>
tag doesn't have any specific attribute.
Global Attributes
Like all other HTML tags, the <ruby>
tag supports the global attributes in HTML5.
Event Attributes
The <ruby>
tag also supports the event attributes in HTML5.
Browser Compatibility
The <ruby>
tag is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: HTML Text Formatting.