Skip navigation


Using Image "alt" Attributes

An alternative to the picture

Okay, the image alt attribute is used to display text in the case someone visits your page with a browser that can't show images, or in the case they have image loading turned off to so pages will load faster. If you have images as links, this is a handy way to let people know what the image was supposed to do. This is the alt command:

alt="something you want to write"

Place this inside the image tag:

<img src="image.gif" alt="something you want to write" />

You place this command inside the image tag for the image you want to display alternate text for. One image I do this with is my "next.jpg" image at the bottom of these pages. I place the text "next" in the alt command, and that is what will be seen if someone sees the page with no images. Here is the example:

<img src="next.jpg" alt="next" />

To see this work, you will probably have to disable image loading and reload this page. You can then scroll down to the bottom right and see the word "next" where the image used to be. Of course, if you have a really new version of IE, you can move your mouse over the image and it will display the alt text right there for you.

So, let's move on once again. The next section is: Linking Within a Single Page.

next

 



Topics: HTML & CSS | JavaScript | CGI & Perl | ASP/PHP | DHTML | Java | Contact Us | Privacy Policy

Copyright © 1997-2010 The Web Design Resource. All rights reserved. Disclaimer.