How to use Dir Attribute in HTML5

In this article I am going to explain about dir attribute in Html5.
  • 2794

Dir Attribute in HTML5

The dir attribute use for defined text direction of an element content. In HTML5 dir attribute can be use on any element but in old version its can not be use with <base>, <frame>, <framesheet>, <hr> etc. there are three value of dir attribute.

  • ltr (Left to right direction)
  • rlt (right to left direction)
  • auto (Based on browser feature)

Browser that supports dir Attribute

Internet explorer, Mozilla firefox, Google chrome, opera and Safari browsers.

syntax

<ElementName dir="lrt|rlt|auto">

Example

<html>

<body>

    <p dir="rtl">

        Hello Friends</p>

</body>

</html>

Output

dirattribute.jpg

Further Readings

You may also want to read these related articles: here
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 


© 2020 DotNetHeaven. All rights reserved.