Solved

Can an alt tag be placed inside an H1 tag?

Posted on 2008-06-19
7
1,061 Views
Last Modified: 2011-10-19
I wanted to jazz up my website and make the headers, which are in H1, now images. I would do an alt tag for those, but is it possible/SEO approved to place that alt tag inside the H1 tag?
0
Comment
Question by:mc2044
  • 3
7 Comments
 
LVL 7

Expert Comment

by:Zippit
ID: 21824381
I assume you mean you are going to use css to give the h1 a background image (via the background-image css tag).

If so, then no, not really.  However, you might try a "hack" like making a transparent image and positioning it over the h1 element and giving the img the alt text. But I'm not sure how a screen reader would interpret something like that.
0
 
LVL 7

Accepted Solution

by:
Zippit earned 125 total points
ID: 21825727
no.  Search engines will ignore any alt value on an H1 tag.  alt is not supported by H1.

If you convert it to an image then you are going to lose any advantage that the H1 text might have had.

You might want to try making that background image a "blank" image with no text.  Then you could make it the background-image of the H1 tag but still just put text into the H1 tag as normal.  You'd get the best of both worlds.

So something like the following:

<h1 style='background-image: url(blankbutton.gif);'>Pictures</h1>
0
 
LVL 7

Expert Comment

by:Zippit
ID: 21826202
This is a really great site for standards-compliant info on HTML/CSS/JavaScript etc:

http://www.w3schools.com/

I am not aware of any <alternative> tag.  I'm guessing they meant the alt attribute on the <img> tag.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question