Just how do you know what to use as alt attributes? Let's take 2 examples, one image is a music logo like "JBL" and another is a pic of yourself, what alt attributes would you use for those two please?
alt attribute is mainly for search engines and people who use the text only version of the site (by blocking images or or by using a text based browser)
Now, think about yourself on how you need to show the site for them.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
>> nowadays, Web browsers are available in a very wide variety of platforms with very different capacities; some cannot display images at all or only a restricted set of type of images; some can be configured to not load images. If your code has the alt attribute set in its images, most of these browsers will display the description you gave instead of the images
>> some of your visitors cannot see images, be they blind, color-blind, low-sighted; the alt attribute is of great help for those people that can rely on it to have a good idea of what's on your page
>> search engine bots belong to the two above categories: if you want your website to be indexed as well as it deserves, use the alt attribute to make sure that they won't miss important sections of your pages.
Also, the "alt" attribute is required to validate. It can be left blank, but still has to be in the img tag. But as an above poster said, its great to have it there for greater purposes.
__________________ Notice: If you post a problem and it gets fixed, please remember to go back and place it as solved. ;)
I always recommend the HEAD First series of books for learning a new coding language. ^_^
A long time ago I read a great article about the alt attribute. Unfortunately I can’t find it anymore. However, the basic message was that you shouldn’t fill the alt attributes just to have something in there as it can also become distracting if there is useless information in them.
For example, if you have some icons in your page they have to have the alt attribute but these don’t/shouldn’t have a value/content as it’s most likely not relevant for the visitor. If you have photos the alt attribute should state what you see on the image. For example “Portrait of John Doe” or “Dog chasing the mailman”. If you have images of text (e. g. buttons or the like) put that text into the alt attribute (e. g. “Home”, “Contact”, …).
As said: Always think of the relevance of the image. If it’s not relevant to know what an image looks like then leave the value of the alt attribute empty. The attribute itself is mandatory, however.
And by the way: Internet Explorer is wrong in displaying the value of the alt attribute as tooltip. That’s what the title attribute is there for.
use background-image property for irrelevant images and img tag for relevant images. Now a days most people not use alt tag to identify images, so i used alt tag to make the page keyword rich.