Ruby annotations
Description.
Ruby annotations are small text written next to or above the main text. They are mainly used in CJK languages to indicate, for example, pronunciation.

Nevertheless, in the examples that follow, we used Ruby notation with texts in French. It is unusual, no doubt, but this will allow the reader not to be distracted by the glyphs of Asian characters.
Ruby and HTML5.
HTML5 includes all the necessary tags to render the Ruby presentation:
Obsolete. Only the rb tag is still included in the standard.
Obsolete. You should now use the rt tag in all cases.
First example. This is the simplest case: only the ruby, rb, and rt tags are used to delimit the container, the main text,
and the annotation text.
It is even possible not to specify the rb tag, as all text included within a ruby element is by default considered main text.
However, this simplification is not recommended, as it would then be more difficult to apply CSS styles to the main text.
‹ruby›
‹rb›TEXT‹/rb›
‹rt›Annotation‹/rt›
‹/ruby›
The rp tag can be added. It will be ignored by browsers that handle Ruby notation, but on browsers that do not support Ruby, it allows a character to be introduced at the beginning and end of the annotation.
‹ruby›
‹rb›TEXT‹/rb›
‹rp›(‹/rp›
‹rt›Annotation‹/rt›
‹rp›)‹/rp›
‹/ruby›
On a compatible browser
On a browser that does
not recognize Ruby notation
Ruby and CSS.
The usual CSS properties can of course be used to style Ruby annotations, as seen in the example below.
‹ruby›
‹rb›TEXT‹/rb›
‹rt›Annotation‹/rt›
‹/ruby›
But there are properties specific to Ruby annotations:
The display property.
The display property allows you to set any element as a Ruby container or an element in a Ruby structure. However, if the document is HTML,
it is preferable to use the predefined HTML tags (see above).
display:ruby;display:ruby-base;display:ruby-text;display:ruby-base-container;display:ruby-text-container;Simulator.
This simulator allows you to get a first idea of the role of each of the CSS properties specific to Ruby annotations. Refer to each property for more detailed explanations.
Browsers compatibility with ruby.
As of now (2025), Ruby annotations and the various CSS properties that allow you to style them are only partially supported by browsers. Refer to the individual properties for more details.
Notes:
(1) Internet Explorer supports the properties of an older specification.
annotations
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

UC Browser pour Androïd

Opéra Mobile

QQ Browser

Baidu Browser

Safari

Samsung Internet

Firefox

KaiOS Browser

Androïd Brower

Chrome

Chrome pour Androïd

Edge

Firefox pour Androïd

Opéra

Safari sur IOS

