2 ms·
In HTML5, it's fine to have multiple `h1` tags on the page, though you can only have 1 in each `section`.
by blowski 14y ago
In HTML5, it's fine to have multiple `h1` tags on the page, though you can only have 1 in each `section`.
- ohwp 14y agoI know it's fine, but I think you shouldn't because of SEO. But to keep this on topic: my point is: a lot of time you can reduce your DOM.
- blowski 14y agoEven then, it's fine as long as you're structuring your page sensibly. For example, on a blog index where each blog post is in a section, it's fine for each blog title to be a h1. Matt Cutts talking about this: http://www.youtube.com/watch?feature=player_embedded&v=GIn5qJKU8VM# http://www.youtube.com/watch?feature=player_embedded&v=G...!
- adlpz 14y agoAs I understand it, the whole "SEO mandates one h1 per site" is outdated. Search engines (read, Google) now follow HTML5 specs and, if you are doing your semantic tagging right, multiple h1 aren't a concern anymore.
- j4_james 14y agoIt's worth mentioning that in HTML 5.1 they are now recommending that you use headings with an appropriate rank. Not that it's wrong to have multiple H1 tags, just not recommended anymore. Exact wording: Sections may contain headings of any rank, but authors are strongly encouraged to use headings of the appropriate rank for the section's nesting level. http://www.w3.org/html/wg/drafts/html/master/sections.html#headings-and-sections http://www.w3.org/html/wg/drafts/html/master/sections.html#h...
- blowski 14y agoHmmm, interesting. So that's going in the other direction to the HTML5 spec, in which you considered a header in relation to the section it's contained in, without worrying about the section's relation to the whole document. It was the browser's job to do the latter. I will keep an eye on this. Thanks for the pointer.
- j4_james 14y agoIn case you're interested, this is the bug report that resulted in the change: https://www.w3.org/Bugs/Public/show_bug.cgi?id=19741 https://www.w3.org/Bugs/Public/show_bug.cgi?id=19741 The final editor's response explains the reasoning: "Change removed advice recommending use of h1 elements as the utline algorithm has virtually no implementations and as a result use of h1 elements flattens document outlines for users who actually consume the heading semantics. While use of elements of the appropriate rank for the section's nesting level is backwards compatible"
- blowski 14y agoThanks for that. I had assumed the header structures was one of the more stable parts of the spec!