Open In App

How to isolate a part of text that may be formatted in a different direction using HTML5 ?

The Task is to learn how to isolate a part of the text that may be formatted in a different direction using HTML5?

Approach: As we know that bdi stands for Bi-Directional Isolation. Basically. It is used to differentiate a text from other text that may be formatted in a different direction. The Task can be done by using the <bdi> Tag in the Document.  



Syntax:

<bdi> Contents... </bdi>

Example Code: The below example illustrate the bdi tag






<!DOCTYPE html>
<html>
  
<body>
    <!--This is heading Tag -->
    <h1>GeeksforGeeks</h1>
    <!--bdi Tag used in unordered list -->
    <ul>
        <h3>bdi Content</h3>
        <li>
            <bdi class="name">Himanshu Jha</bdi>: indian name
        </li>
        <li>
            <bdi class="name">الرجل القوي إيان</bdi>: arabic name
        </li>
        <li><bdi>Manas Chhabra</bdi>
        </li>
        <li><bdi>GeeksForGeeks</bdi></li>
    </ul>
</body>
  
</html>

Output 

Supported Browsers:  Google ChromeFirefoxOperaSafar

Article Tags :