www.webdeveloper.com
Results 1 to 5 of 5

Thread: Making h title a link

  1. #1
    Join Date
    May 2008
    Posts
    296

    Making h title a link

    Hello,

    I have a heading like:

    <h2 class="content">Accessories</h2>

    Now, I make this a link. So, it becomes:
    <a href="...."><h2 class="content">Accessories</h2></a>

    When I made this heading a link, would this still be considered as a heading

    A) semantically
    B) and for SEO purposes?

  2. #2
    Join Date
    Jun 2005
    Location
    United Kingdom
    Posts
    1,043
    I see no reason why not. However if the link is styled so that it looks like other h elements then it may not be obvious to your site visitor that it is a link - yet leaving it with an underline and maybe a different colour could look messy.

  3. #3
    Join Date
    Sep 2008
    Location
    Mexico
    Posts
    786
    Quote Originally Posted by ketanco View Post
    <a href="...."><h2 class="content">Accessories</h2></a>
    should be...
    HTML Code:
    <h2 class="content"><a href="....">Accessories</a></h2>
    BLOCK level elements cannot be placed inside INLINE elements.

    And you can style it any way that fits your needs with CSS
    ...but stupidity is terminal.

  4. #4
    Join Date
    May 2008
    Posts
    296

  5. #5
    Join Date
    Jun 2005
    Location
    United Kingdom
    Posts
    1,043
    Quote Originally Posted by opifex View Post
    should be...
    HTML Code:
    <h2 class="content"><a href="....">Accessories</a></h2>
    BLOCK level elements cannot be placed inside INLINE elements.
    .....
    Oops - didn't spot that coding.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles