Forum Moderators: open
The ALT [w3.org] attribute is defined in a set of tags (namely, img, area and optionally for input and applet) to allow you to provide a text equivalent for the object so that handicapped users, or those using non-image browses, may accurately identify the missing image. Use the attribute for what is is intended, i.e., describe the image.
elements = starttag [content] [endtag]
starttag = <elementname attributes*>
attributes = name="value"
IMG [w3.org], BODY [w3.org], A [w3.org] are elements which consist out of a starttag, some content and an endtag. In empty elements there is no content. In HTML quite a few endtags are optional. In XHTML they are not. The starttag may contain attributes which consist of a name and a value.
Using the correct syntax will help to know what people are talking about and will make searching a lot easier since you can just search for the alt [w3.org] attribute or the IMG [w3.org] element.
Andreas
However, the IMG tag can also take a "title" attribute, which IMO google is less restrictive about.
So IF I am right, something like this won't get you penalized:
<IMG SRC="enter.gif" alt="click here to enter my site" title="shiny, dotty widgets"> What the "title" attribute is supposed to do, is show up as a tooltip, so IE doesn't actually comply with the HTML specs when it shows the "alt"-text as a tooltip (at least, thats the help files in Mozilla tell me). However, when both "alt" and "title" is present, IE handle it correctly.
Alt tag has been abused for too long so I suspect it is read by google with caution. No more than 4 words describing the image is the correct way to do it, and no words for a blank gif used as a spacer.
However, if you can describe the image in a way that helps the user + get a keyword in.... thats sensible and may help your ranking. If you use the same phrase for all the images I reckon google will smell a rat. So be accurate and helpfull.... but try and use a keyword where possible.
As MHes points out, it has been abused so search engines may not look kindly on it.
The W3C have a draft HTML4 Test Suite, which is useful for testing search engine robots as well as user agents. If you search for the following you'll see what I mean (including quotes):
"below cannot be displayed so the text" passes
"below cannot be displayed so the text"
The behaviour is different if the IMG is in a link.
andreasfriedrich - Alt tag has had keywords stuffed into them
Also, unless the search phrase you're targeting is "spacer", I wouldn't ever put keywords into 1-pixel gif's.
nyehouse
Disagree. I think Google pays attention to alt tags and gives some credit for them. They also penalise sites with excessive / Spam alts, be warned. That is where the old spammers used to spam most.
jojojo
I think img and alt's are important for a number of reasons. If I have, say, 7 or more .jpgs (don't do this with gif images - Google look on these as lesser images). I like to make sure my images contain the main keyword in two of the image names. I like to make sure the image name blue-widget.jpg has the alt "My Blue Widget". I also like to make sure all my keywords are used somewhere, and / or associated words.
Images are, IMHO, not big for competitive keywords, but every little helps. Also, I truly believe if you are smart, they will help you a LOT with secondary keywords.
The alt attribute is a required element in HTML 4.01, so for spacer images you should use alt="" and for bullet point images you can use alt="*" for example.
Try browsing this or any other forum with the image loading turned off. Without the alt attribute, you wouldn't know which button was which.
You can also use it in hrefs, but I was suggesting using title in imgs for SEO purposes. From Phoenix Browser FAQ:
Many sites uses the alt HTML property to display tooltips for images. This is wrong. The correct property to use for tooltips is title. The alt property has a very important purpose, which is to provide replacement text for images in browsers that cannot or do not (by user's choice) display images, and if graphical browsers display them as tooltips people will be discouraged from using them for their correct purpose.
We all know IE is not a compliant with w3c specs and that Mozilla for the most part is, but what this difference of opinion has done, is left us a way to better optimize our pages. With careful consideration, and a thoughtful eye to moderate these attributes benefits and exploit their ability to better show what product or service your are marketing, then why argue semantics and lets use this to benefit ourselves and our customer base, yes? And I believe this was GrinninGordon's original intent.