SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist stonedeft's Avatar
    Join Date
    Aug 2009
    Posts
    589
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    a tags inside h tags or vise versa...confused

    Both works but w/c one is the RIGHT one

    1.
    Code HTML4Strict:
    <h1><a href="#">my link</a></h1>

    or

    2.
    Code HTML4Strict:
    <a href="#"><h1>My Link</h1></a>

    ...confused
    Don't Panic

  2. #2
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    622
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This is correct
    Code:
    <h1><a href="#">my link</a></h1>
    because <h1> is block level element.

    <a> is inline element.

    you cannot write block level elements inside inline elements.

    vineet

  3. #3
    SitePoint Evangelist stonedeft's Avatar
    Join Date
    Aug 2009
    Posts
    589
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Ill remember that
    Don't Panic


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •