joi, 21 aprilie 2011

Alt Attribute

Tag attributes should be used through your HTML pages. Tag or code attributes are bits of text that can be added to a tag or piece of code to define or describe it. These are good places to add your keywords in where a description is called for. The alt attribute is part of the img tag. You'll often see it like this:

<img src="seo-course-logo.gif" width="200" height="100" border="0" alt="Backlink Builder SEO Course Logo" title="Backlink Builder SEO Course">

Here you also see the use of the title attribute. This isn't new, although it really isn't used by most webmasters. If you want to check on things, it is part of the W3C specification, and therefore should be used. As well, for those surfing with IE, they will see the alt attribute information when they hover over the image. Those surfing with Mozilla (Firefox) will see the title attribute information, not the alt attribute.
Backlink Builder SEO Course Logo. I consider this good use of the attribute as it utilizes a keyword, and at the same time describes the image. Two birds with one stone so to speak. Poor birds.

The W3C calls the alt attribute mandatory, so always include it. If your image is simply a spacer, or background, you may be best off not specifying it, but include the empty tag anyway as alt="". This may sound ridiculous to you, but it is in the W3C Recommendation, so it's official!

Always use a keyword or phrase in the alt tag, if at all possible but don't stuff the tag. The tag is meant for people who have images turned off in their browsers, or for browsers that don't display images. You want to portray to these people what this image is. A list of keywords doesn't do that. A nice description can however include a keyword or phrase.

I've never seen any facts about how long an alt tag should be, but common sense tells me that since it is meant to be a short description of what the image is, it should be just that. Short. Keep it to a short sentence. As a matter of fact, if you think about it, the attribute is intended for people not only surfing with images turned off, or textual browsers with no images, but for those visually and hearing impaired. The alt attribute is rendered in braile (so I've been told ... I have no clue how it is done), or speech. Anything beyond a simple explanation is going to slow down the entire process of viewing a webpage to these people.

Niciun comentariu:

Trimiteți un comentariu