Working With the Language Elements in HTML5

Here you will learn how to work with HTML5 Language Elements.

The ruby, rt, and rp elements

Ruby characters are notations placed above or to the right of characters in a logographic language (such as Chinese or Japanese).

We use a ruby element in conjunction with the rt and rp elements, that are also new in HTML5.

The rt element marks the ruby notation, and the rp element denotes parentheses around an annotation that can be displayed by browsers that don’t support ruby annotations.

Example

<html>
<head>
    <title>Ruby Example</title>
</head> 
<body>
    <p>
        Abhijeet aka
        <ruby>AJ <rp>(</rp><rt>Abhijeet</rt><rp>)</rp
</ruby>
    </p>
</body>
</html>




The bdo Element

The bdo element specifies an explicit text direction for its content, overriding the automatic directionality that would usually be applied. We must use the bdo element with the dir attribute, that has the allowed values of rtl (for right-to-left layout) and ltr (for left-to-right layout).

Example

<html>
<head>
    <title>BDO Example</title>
</head>
<body>
    <p>
        It isleft-to-right: <bdo dir="ltr">Hello guyz</bdo>
    </p>
    <p>
        It is right-to-left: <bdo dir="rtl">Hello
guyz
</bdo>
    </p>
</body>
</html>





The bdo element specifies an explicit text direction for its content, overriding the automatic directionality that would usually be applied.