HTML Tags

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:

HTML / XHTML: <ruby> ... </ruby>

The example below shows the <ruby> tag in action.

<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.

Browsers Icon

Basic Support—

  • Firefox ×
  • Google Chrome 5+
  • Internet Explorer 5.5+
  • Apple Safari 5+
  • Opera 15+

Further Reading

See tutorial on: HTML Text Formatting.

Related tags: <rt>, <rp>.

Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties