Offering Alternate Text

While images are great on a big screen with a fast connection, they can be less useful—and downright problematic—on handhelds, phones, slow connections, or for the blind. You can add descriptive text that will appear if the image, for whatever reason, does not.

To offer alternate text when images don’t appear:

1.
Within the img tag, after the src attribute and value, type alt=".
2.
Type the text that should appear if, for some reason, the image itself does not.
3.
Type ".
Figure 5.9. While the alternate text can theoretically be as long as you like, most browsers don’t automatically wrap long lines. Therefore, it’s a good idea to keep it under 50 characters or so.

Figure 5.10. In Internet Explorer, the alternate ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.