Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a H1 logo in HTML5

The "h1 tag with an image" debate seems as old as time itself, but with HTML5 explicitly allowing multiple H1 tags as part of its spec, all the previous questions on this subject seem out of date.

As I understand it, the following works perfectly with the HTML OA:

<body>
  <header>
    <h1>
      <a href="http://www.example.com"> 
        <img src="logo.png" alt="Ernie's Restaurant - Great Italian food">
      </a>
    </h1>
  </header>

  <nav><!-- the site-wide navigation --></nav> 

  <article>
    <h1>About us</h1>
    <p>…</p>
  </article>

</body>

But I'm working with an SEO company on a website and they've told me:

"The logo link CAN’T be H1. It doesn’t make sense."

Are they right? Is there something bad about the above document outline? If you can't put the logo in a H1 tag, why do the W3C do it themselves on their website?

These people are supposedly SEO experts, but I just don't understand their complaint. What am I missing?

like image 616
Chuck Le Butt Avatar asked Sep 17 '25 04:09

Chuck Le Butt


1 Answers

Most of the time, you'd want to wrap the image in an anchor, which also has a title... See This answer and This answer.

Maybe they were just nervous about the lack of a proper anchor? The img tag is entirely legitimate.

like image 59
Jeff Watkins Avatar answered Sep 18 '25 19:09

Jeff Watkins