Problem with HTML document validation

Asked

Viewed 70 times

3

When validating my HTML document this giving the following problem

Section Lacks Heading. Consider using H2-H6 Elements

But I don’t need it, it’s really unnecessary for the purpose of my site (titles only in articles, blog style). Can I ignore this or can it hurt me? Being forced to hide this title in CSS?

Example of my code

 <header>
       <h1></h1> --
       <nav>
       </nav>
    </header>
    <main>
       <section>
          <article>
             <h2></h2> --
          </article>
       </section>
    </main>

1 answer

4


If you want to conform to this pattern you need to put a header, as it was done.

And of course you can ignore alerts as you wish. I see no problem if it is your wish. It’s not an obligation, it’s not an official mistake, it’s just a recommendation.

If you still want to conform to the standard and not have this warning consider changing the <section> by a <div>, for example. A section requires a header, a division does not require. It is your decision which is most suitable.

Specification.

Browser other questions tagged

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