Code has been added to clipboard!

Using ruby HTML Tag

Reading time 1 min
Published Jun 29, 2017
Updated Sep 11, 2019

ruby HTML: Main Tips

  • <ruby> tag represents ruby annotations for East Asian characters.
  • It is used to convey the right pronunciation, as some characters have multiple options.
  • HTML ruby tag was introduced in HTML5 and supports all global attributes.
  • You cannot omit the ending tag.

Providing Ruby Annotations

HTML ruby tags are used to provide the information on how to pronounce Japanese, Chinese, and Korean characters:

Example
<ruby>攻殻
  <rp></rp>
  <rt>こrうかく</rt>
  <rp></rp>
  機動隊
  <rp></rp>
  <rt>きsどうたtい</rt>
  <rp></rp>
</ruby>

As you can see in the example above, there are a few elements used for HTML ruby annotations:

  • <ruby> defines a connection between the base text and the ruby HTML text.
  • <rt> specifies the ruby HTML text element, which may contain inline elements.
  • <rp> surrounds the ruby parentheses for the browsers that do not support ruby HTML text.

Note: the level of support for ruby annotations differs greatly between browsers and their versions: you can check it here.

Browser Support

Chrome
5+
Edge
All
Firefox
38+
IE
5+
Opera
15+
Safari
5+

Mobile Browser Support

Chrome
All
Firefox
38+
Opera
14+
Safari
All
Basics
Introduction
Syntax
Editors
Basic Examples
Head Section
<!DOCTYPE>
Tags and Elements
Semantic Elements
Tags Reference
Attributes
Comments
Block and Inline Elements
Forms
Form Elements
Input
Responsive Web Design
Inline Scripts
Uniform Resource Locator
Redirect
XHTML
Geolocation
Drag and Drop
Local Storage
Web Workers
Server-Sent Events
Character Encoding
Text Formatting
Quotation and Citation Elements
Headings
Paragraphs
Links
Tables
Lists
Symbols
Space
Tab
Styles
Computer Code
Layout
Classes
Colors
Images
iframes
Audio Player
Video Player
YouTube Videos
Multimedia
Canvas
SVG
<!-- -->
<a>
<abbr>
<acronym> DEPRECATED
<address>
<applet> DEPRECATED
<article>
<aside>
<audio>
<b>
<base>
<basefont> DEPRECATED
<bdi>
<bdo>
<big> DEPRECATED
<blink> DEPRECATED
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center> DEPRECATED
<cite>
<code>
<col>
<colgroup>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir> DEPRECATED
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font> DEPRECATED
<footer>
<form>
<frame> DEPRECATED
<frameset> DEPRECATED
<h1> – <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<keygen> DEPRECATED
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<menu>
<menuitem> DEPRECATED
<meta>
<meter>
<nav>
<noframes> DEPRECATED
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike> DEPRECATED
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt> DEPRECATED
<u>
<ul>
<var>
<video>
<wbr>