Linking a Title Tag - Which is Correct?

Discussion in 'HTML & Website Design' started by travoholic, Jul 30, 2009.

  1. #1
    This: <a href=""><h2>Title</h2></a?

    Or this: <h2><a href="">Title</a></h2>?

    Thanks!
     
    travoholic, Jul 30, 2009 IP
  2. Webray

    Webray Active Member

    Messages:
    469
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    I like this one best.
     
    Webray, Jul 30, 2009 IP
  3. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #3
    The second one is correct. The first is invalid.
     
    drhowarddrfine, Jul 30, 2009 IP
  4. travoholic

    travoholic Well-Known Member

    Messages:
    299
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Thanks for your help!
     
    travoholic, Aug 1, 2009 IP
  5. thr3146

    thr3146 Active Member

    Messages:
    182
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Interesting...can you explain further because i'm pretty sure I do this in some of my hurried coding.
     
    thr3146, Aug 1, 2009 IP
  6. unigogo

    unigogo Peon

    Messages:
    286
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    <a></a> is inline element,<h2></h2> is block element. Inline element should be in the block element.
     
    unigogo, Aug 1, 2009 IP
    thr3146 likes this.
  7. thr3146

    thr3146 Active Member

    Messages:
    182
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #7
    Hey thanks for clarifying unigogo...just checked your sig, that's a really cool site...passing it along to a couple of friends. Great work!
     
    thr3146, Aug 1, 2009 IP