Use more than one H1?

Asked

Viewed 1,234 times

5

If I’ve ever used one H1 to set my Header logo/title, I can use some more H1 on page ? or just H2.. ? I can’t remember where I read, but I can use H1 in every article or section ?

<header>
   <h1>logo</h1>
</header>
<section>
   <article>
      <h2>titulo do post</h2>
      <p>descrição</p>
      content..
   </article>
</section>

2 answers

3


You can use how many h1, h2 and others as often as you want.

Take into account that the semantic function is to highlight the content of this piece/tag. Both visually and in terms of SEO (Google indexing for example). So you should manage and use these tags carefully, sense of organization. But you can use as many times as you want.

In W3C specifications this example can be seen, with multiple h1:

<body>
    <h1>Apples</h1>
    <p>Apples are fruit.</p>
    <section>
        <h1>Taste</h1>
        <p>They taste lovely.</p>
        <section>
            <h1>Sweet</h1>
            <p>Red apples are sweeter than green ones.</p>
        </section>
    </section>
    <section>
        <h1>Color</h1>
        <p>Apples come in various colors.</p>
    </section>
</body>

There are tags that can only be used once per page. Among these are html, head, base, title and body.

  • 1

    Mt thanks, I think I understood well, and tbm I did not know the W3C recommendations, this will help MT ..

2

In a very concise and objective way, yes, you can use it more than once.

H1 only defines the level of importance of the title.

If the page contains, for example, a call for 5 articles, usually each article has a title, then each call will have the title within a H1.

Example:

<header>
   <h1>logo</h1>
</header>
<section>
   <article>
      <h1>titulo do post 1</h1>
      <p>descrição</p>
      content..
   </article>
   <article>
      <h1>titulo do post 2</h1>
      <p>descrição</p>
      content..
   </article>
   <article>
      <h1>titulo do post 3</h1>
      <p>descrição</p>
      content..
   </article>
</section>
  • To put my article subheadings in <H2> do I have to create several <Section> within <article>? Or I can insert the <H2> directly into the <article>?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.