• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using an alt attribute with HTML elements

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<img id="myImage" src="image.gif" alt="An image" title="This is an image"/>

The docs says these things but i couldn't get this

Purpose of ALT

“Several non-textual elements (IMG, AREA, APPLET, and INPUT) let authors specify alternate text to serve as content when the element cannot be rendered normally.”

I can't understand what is the use of using an alt attribute .



 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read what the w3c sayys about it: http://www.w3.org/QA/Tips/altAttribute

Eric
 
Brian Legg
Ranch Hand
Posts: 488
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RaviNada Kiran wrote:
I can't understand what is the use of using an alt attribute .


The reason you use an alt attribute is to prevent parts of your pages appearing missing if someone comes to your site that can't view certain things. If someone has their browser configured to not show text or applets then instead of a giant missing area you can put text there like, "Enable Applets to view this content" or something like that.

HTH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic