Last Updated on April 26, 2023 by Roshan Parihar
HTML bdi tag is used to specify the bidirectional text in a website. The bidirectional text are the text write from left-to-right or right-to-left directions.
The syntax for bdi tag is:
1 |
<bdi dir="specify direction here">Enter some text here for bidirection</bdi> |
For Example:
This is the example of the bdi tag specifying text in bidirectional way.
1 2 3 4 5 6 7 8 9 10 |
<!DOCTYPE html> <html> <head> <title>bdi tag</title> </head> <body> <a href="html-anchor-tag/">anchor tag with url</a> <p>This is the example showing the <bdi dir="rtl">bidirectional</bdi> text to use inside the web pages.</p> </body> </html> |
Output
This is the example showing the bidirectional text to use inside the web pages.
Example for HTML bdi tag with header, content and footer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<!DOCTYPE html> <html> <head> <title>bdi tag example</title> </head> <body> <article> <header> <h3>This is the heading inside header tag.</h3> <p>Below is the menus which we can call as a navigational links inside header tag.</p> <ul><li><a href="#">Home</a></li><li><bdi>put arabic text here</bdi></li><li><a href="#">About</a></li><li><a href="#">Contacts</a></li><li><a href="html-header-tag">HTML Header Tag</a></li></ul> </header> <h3>This is the article Heading</h3> <p>The paragraph to include any content will comes here. This paragraph can be in many forms and contains many short paragraphs.</p> <p><bdi>put arabic text here</bdi></p> </article> <footer> <p>copyright@2017 mywebsite.com. All Rights Reserved.</p> <p><bdi>put arabic text here</bdi></p> </footer> </body> </html> |
Output
This is the heading inside header tag.
Below is the menus which we can call as a navigational links inside header tag.
- Home
- put arabic text here
- About
- Contacts
- HTML Header Tag
This is the article Heading
The paragraph to include any content will comes here. This paragraph can be in many forms and contains many short paragraphs.
put arabic text here
See W3C Specification for this tag.