PDA

View Full Version : Problem with Image "alt" tag



terrycr
12 May 2007, 01:26 PM
For the life of me I can not figure out why the "alt" text does not show up on my images when you mouse over them. The website is: www.rookaps.com

Here is an example of how I coded throughout the site:

<div style="position:absolute;left:461;top:86;width:197;height:26;">

<img src="rookaps001006.gif" title="" alt="Replace Your Lost Flash Drive Cap" align="top" border="0" vspace="0" hspace="0">

</div>
Help... am I missing something?

Wickham
12 May 2007, 03:04 PM
The text in the yellow box does show if you use title="image text" (you have title="" but no text inside). I downloaded your page and rookaps001008.gif to test.

Alt should show the text in IE but never in Firefox if you had a doctype, but as you haven't got a doctype it isn't even showing in IE.

Firefox is probably correct because it is not required to show the text on hover if the image shows, it is there to show if the image fails to load. In Firefox and most browsers even if the image shows you should be able to see the alt text by right-clicking the image and looking at the properties.

If you want the alt text to show in Firefox when just hovering over the image, add title="image name" as well as alt="..." as in <img src="image.jpg" alt="image name" title="image name"> In your case without a doctype this will make it appear in IE too.