Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Use of dir attribute in Html

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 385
    Comment on it

    dir attribute:

    It is used to specify the direction of text in Html element content. In Html5 it can be used with any html element. Prior to Html5 it cannot be used with <base>, <br>, <frame>, <frameset>, <hr>, <iframe>, <param>, and <script> tag .



    <element dir="ltr|rtl|auto"> 

    Attribute Values:


    Value Description
    ltr Left-to-right text direction(Default)
    rtl Right-to-left text direction
    auto Browser figure out the text direction, based on the content


    <!DOCTYPE html>
    <h4>Paragraph direction will from right to left</h4>
    <p dir="rtl">keep in touch!</p>
    <h4>Paragraph direction will from left to right</h4>
    <p dir="ltr">keep in touch!</p>

    In the above example the first <p> tag will appear on right side(right to left) and the other on left side (left to right).

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: