Posts page has multiple
<h1> tags (one for every post). There are almost no
<h2> tags on the page.
Do you think it's fine to have multiple
<h1> tags if each of those tags have equal importance?
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.Sign up to join this community
The answer is no. There should be only one
<h1> element on a page. And, interestingly enough, there was an article that came out just today about this as far as use with
In any case, browsers still treat
<h1> as the heading for the whole page.
If you have multiple blog posts (whether with full text or just teasers) on a page, each post should get its own
The first heading element (
h6) in the
article (and not nested in another sectioning content element) will be that article’s heading.
HTML 5.1 allows authors to use
h1 all the time, but it recommends that authors use
[…] headings of the appropriate rank for the section’s nesting level.
The following snippets show what is recommended:
<body> <article> <h2></h2> <!-- <h2> because the <article> is on the second level (<body> being the first one) --> </article> <article> <h2></h2> </article> </body>
<body> <section> <article> <h3></h3> <!-- <h3> because the <article> is on the third level (<body> being the first one, <section> being the second one) --> </article> <article> <h3></h3> </article> </section> </body>
<body> <div> <article> <h2></h2> <!-- <h2> because the <article> is on the second level (<body> being the first one); as <div> is not a sectioning content element, it doesn’t represent a nesting level for the outline --> </article> <article> <h2></h2> </article> </div> </body>
But in those three examples, it would be valid to use
h1 (or any other heading element) instead.