Solved

Can an alt tag be placed inside an H1 tag?

Posted on 2008-06-19
7
1,048 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Read about how to approach blogging and about ways to do it right. Stand out from the crowd and let your knowledge be consumed by a large audience. This article aims to explain how your blog should look like,  the most important things to do while b…
Read about why website design really matters in today's demanding market.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

919 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now