| 3:52 pm on Feb 20, 2009 (gmt 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"
<!-- doctype on one line of course -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<h1><a href="mypage.htm">My Title</a></h1>
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)|
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)|
|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)|
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)|
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...*
*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)|
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)|
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)|
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)|
That's fine. It links to same page. Main discussion was about linking to a different page.