Reputation: 47375
Working with a layout in MVC3 that currently has no H1 element. The only thing that would qualify as an H1 would be a company logo in the banner.
If I put the image in the banner, along with text, what would the SEO implications be? Something like the following:
<h1>
<img src="/path/to/transparent.gif" alt="My Company Logo" />
<span style="display:none;">My Company Name</span>
</h1>
Or, could even position the span absolutely and position it out of the viewport. I know search engines are smarter about indexing only content that is shown to the user. But how should I approach this situation? Do I need the additional text, or will crawlers index the img's alt attribute?
Upvotes: 0
Views: 352
Reputation: 1556
In HTML5 you might do:
<hgroup>
<h1><img src="/path/to/transparent.gif" alt="My Company Logo" /></h1>
<h2>My Company Name</h2>
</hgroup>
Upvotes: 0
Reputation: 675
Yes, any inline element can be contained within an h1 element. And don't worry about the span. Most search engines index the alt text. Even see the w3.org's own website for an example. They do this with their logo.
Upvotes: 2
Reputation: 1143
You may want to look into using the new <header>
tag from the HTML5 specification, which can contain any element.
See:
HTML 5 and SEO -- http://www.webconfs.com/html5-seo-article-27.php
HTML5 <header>
Tag -- http://www.w3schools.com/html5/tag_header.asp
Upvotes: 0