Please help with this simple question about the correct html code

Discussion in 'HTML & Website Design' started by roweis, Sep 9, 2011.

  1. #1
    Hello!

    I would appreciate if someone could help me with a simple question about html code. However, it's not that simple for me! Here is my question: I would like to link to another web site, but I would like the link to be nofollow and I would like the target to open in a new window. Let's say that the url of the other website is: http://www.theotherwebsite.com, which of the following two codes would I use (or are they both valid):

    <a href="http://www.theotherwebsite.com" rel="nofollow" target="_blank">The Other Website</a>

    or

    <a href="http://www.theotherwebsite.com" target="_blank" rel="nofollow">The Other Website</a>

    In other words, which one comes first, the target="_blank" or the rel="nofollow" ? Thank you very much for your help!

    Robert
     
    roweis, Sep 9, 2011 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,845
    Likes Received:
    4,543
    Best Answers:
    123
    Trophy Points:
    665
    #2
    the order doesn't matter. Each "attribute" of the link is valid regardless.
     
    sarahk, Sep 9, 2011 IP
  3. mmerlinn

    mmerlinn Prominent Member

    Messages:
    3,197
    Likes Received:
    819
    Best Answers:
    7
    Trophy Points:
    320
    #3
    As stated, order does not matter.

    It is simple for you. All you had to do was try both of them. You would have seen no difference.
     
    mmerlinn, Sep 9, 2011 IP
  4. roweis

    roweis Member

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    Thank you very much for your help!

    Robert
     
    roweis, Sep 10, 2011 IP
  5. tonywhite

    tonywhite Peon

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The right way to do that is this :
    <a href="http://www.theotherwebsite.com" target="_blank" rel="nofollow">The Other Website</a>

    or
    <a href="http://www.theotherwebsite.com" target="_blank" rel="nofollow">The Other Website</a>

    Any of them :) :D :D :D
     
    tonywhite, Sep 16, 2011 IP
  6. shailenderkumar

    shailenderkumar Member

    Messages:
    89
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #6
    HTML is really simple language, don't get confused with using HTML attributes and codes.
     
    shailenderkumar, Sep 16, 2011 IP