[Home]ALT attribute

HomePage | RecentChanges | Preferences | Newbie Help

Category HTML FAQ

Comments --

The alt text attribute is only meant to display when a visitor is surfing your site with images off or there is a broken link to a graphic, it also displays in the space of the graphic while the graphic is downloading. The attribute is required in HTML4 and XHTML.

To display balloon text you should use the title attribute to ensure cross browser compatibility. the correct format for displaying a text balloon for most browsers is:

<IMG src="an_image.gif" alt="bla bla bla" title="bla bla bla">

Remember, alt text is not a description of the image. If the image could be removed from the visual, graphical version of the page while keeping it making sense, then in most cases you don't need alt text. For a description - such as "this is a photograph of my dog" - then use the title attribute.

Don't over-use alt text! You need just enough to make your page understandable without images, but so it doesn't get confusing or hard to read.

If images or disabled or the image cannot be loaded, then the browser should show the alt text as plain text, not as part of a "broken image" icon (most browsers do not do this, however). This means you should use textual markup with alt text, such as <h1><img src="allmyfaqs-logo.png" alt="All My FAQs" /></h1> for a header graphic.

further reading:

alt text: http://www.w3.org/TR/html4/struct/objects.html#adef-alt

title text: http://www.w3.org/TR/html4/struct/global.html#h-7.4.3

"animating" links http://www.cs.tut.fi/~jkorpela/www/links.html#anim

HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited June 28, 2002 3:20 pm (diff)

This FAQ is happily hosted by Betadome Digital Media