top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the use for alt attribute in <img> tag?

+1 vote
394 views

I know it is a alternate name for image.Any one tell what is the primary use for this ?

posted Jul 2, 2014 by Sidharth Malhotra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Let's Make It Easy :

Suppose you have an image in your HTML website. To display the image on your website you use <img> tag something like below :
________________________________________________________
 <img src="mylaptopshop.jpg" alt="My laptop shop has many laptops"/>
________________________________________________________
In above example  : " My laptop shop has many laptops " is basically a description about the image. Particularly referred as alternative text.
Note : It just give the basic info not the complete visual description.

THINGS TO KNOW

# In IE7 and other web browser it works as a Tooltip.
# According to W3C and some discussion on the Internet : alt attribute helps the search engine bots to index properly to make your website images  visible on the top.
# And this attribute is also helpful for color blind people as it consist of the text description.

1 Answer

0 votes

Hi,

The alt attribute is used in HTML and XHTML documents to specify alternative text (alt text) that is to be rendered when the element to which it is applied cannot be rendered.

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

Example For Img Tag

<img src="smiley.gif" alt="Smiley face" width="42" height="42">
answer Jul 3, 2014 by Madhavi Latha
Similar Questions
+10 votes

what is the use and purpose of in HTML 5?

+4 votes

Question related to a internal company knowledge transfer site. Suppose there is a tag like PHP and I want to send mail to the PHP followers when a new question is posted in PHP tag?

Can i get any logic for it ?

...