Welcome to WebmasterWorld Guest from 54.145.205.178

Forum Moderators: ergophobe

Message Too Old, No Replies

href's within H tags?

     
3:14 pm on Feb 20, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 22, 2005
posts:70
votes: 0


I wasn't really sure where to post this question so - foo it is :)

We are having a discussion around the office regarding the SEO impact of having our Header tags be clickable and I thought I'd ask the WebmasterWorld community what their thoughts are on the topic.

<H1><a href="mypage.htm">My Title</a></H1>

I know it isn't w3 compliant but would this have a positive or negative SEO impact?

3:52 pm on Feb 20, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Who says it's not w3C compliant?

As is, it validates fine in HTML.

If you are using XHTML, which you should only do if you need to use XHTML features, the only thing invalid there is H1 is in caps and needs to be h1.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- doctype on one line of course -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Untitled</title>
</head>
<body>
<h1><a href="mypage.htm">My Title</a></h1>
</body>
</html>

Validates fine. This will probably get moved to HTML/Browsers or accessibility, somewhere in there . . . . but don't see a real problem with this approach. See recent related discussion [webmasterworld.com]

10:51 pm on Feb 20, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 17, 2001
posts:1262
votes: 0


I can think of no justification for a hyperlink inside an <h1>.

The <h1> is the top-level heading on the page. What would it be linking to except itself? If you have multiple <h1>s or if they don't encapsulate the main topic of the page, your semantics are off. That can potentially throw off screen readers— and search engines— which is presumably why this thread was moved to the Accessibility & Usability forum.

11:04 pm on Feb 20, 2009 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts: 12171
votes: 60


I can think of no justification for a hyperlink inside an <h1>

I can't either, it just doesn't seem correct but it is allowed.

<h2> thru <h6> yes, but not <h1>.

Where would you link it to? Same page? Nah, can't do that.

1:26 am on Feb 21, 2009 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10681
votes: 33


i could see a case for linking to a fragment identifier on the page.
for example a page displaying the header element followed by a large image followed by the relevant text.
4:27 am on Feb 21, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 30, 2003
posts:728
votes: 0


It doesn't seem like such a strange use case to me...what about something like this?

<h1><a href="/obama.html" title="About Barack Obama">Barack Obama</a> Elected!</h1>

The hypothetical document with the above heading is a document about somebody getting elected, while the linked page is perhaps a document detailing the subject's biography or CV...*

--b

*Admittedly, the link text in the example above is not that great, but I think the principle is sound...

2:35 pm on Feb 21, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 22, 2005
posts:70
votes: 0


Perhaps using the H1 as the example was misleading, I agree that the H1 on page "should" be specific to the page that it resides on.
While H2's thru H6's can link out to other relevant pages.
1:02 am on Apr 25, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


A heading usually sits above, and introduces, the following paragraph, list, table, form, or image (or combination of).

There's little reason for it to link to some other page.

9:03 pm on Apr 28, 2009 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member piatkow is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 5, 2006
posts:3360
votes: 31


I would put an anchor tag on an h1 but just with a name attribute for a "return to top" link. For "h" tags more generally I can't see why it should be an issue although I would typically link from content underneath a header rather than for the header itself.
9:56 pm on Apr 28, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


That's fine. It links to same page. Main discussion was about linking to a different page.