Forum Moderators: open

Message Too Old, No Replies

<img> validation and alt="x" attributes

cursor changes, tool-tips and related issues

         

D_Blackwell

7:02 pm on Aug 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In trying to validate my code I'm getting an error the the "required atribute alt is not specified". The site has images of products in every concievable color. I'm not entirely opposed to adding the alt reference, but can't live the IE bar that comes up to display the text. If I can turn this off, I would probably add the alt. I have a meta tag that I use to turn off the "imagetoolbar". Is there a similar tag to turn off the alt 'toolbar'? And is this only an IE issue? I think so, but could use confirmation.

NickH

8:07 pm on Aug 2, 2003 (gmt 0)

10+ Year Member



You can switch off the tooltip in IE by adding a blank title attribute: title=""

As far as I know, IE is the only major browser that displays the alt-text in this way.

You can also switch off the tooltip, and remain valid, by specifying alt="". However, you should do this only if the image is purely decorative; i.e., your page would have essentially the same content without the image. (For example, a bullet image.)

Nick

vincevincevince

9:47 pm on Aug 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't forget that ALT text helps your google relevancy a bit

D_Blackwell

11:53 pm on Aug 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks. It looks like -- specifying alt="" -- will do the trick. The images are more than decorative (lots of colors to the same product line) but neither the owner, nor I, care to see those toolbars popping up like popcorn.

Is there a <meta> that will allow me to use the alt as intended yet turn off the IE toolbar? This is what I use for the "imagetoolbar".
<meta http-equiv="imagetoolbar" content="no>

A related question. I'm working on another site with a similar issue. However, -- body {cursor: crosshair} -- is specified. In this case, I do want to allow the alt="xxx". But when the text comes up, it comes up with the arrow cursor -- and flickers back and forth between the two. How can I keep the crosshair and the text -- or will I have to switch to the arrow?

g1smd

7:08 pm on Aug 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The title attribute on an <a> anchor is supposed to pop up a tooltip. This happens on most modern browsers.

The alt attribute on an <img> tag is NOT supposed to pop up a tooltip, but does so on some older browsers.

Valid: <a href="/path/somefile.html" title="text about the link">some text here</a>

Valid: <img src="image.png" alt="short text here" height="100" width="100">

Valid: <a href="/path/somefile.html" title="text about the link"><img src="image.png" alt="short text here" height="100" width="100"></a>

Add alt="some text" to every <img > tag, the text reflecting what is in the dispayed image. On unimportant images, like spacer elements, a minimum of alt="" is fine. For bullet-point images, alt="*" is often used. Search engines do index the alt text. The alt attribute is a required element.

The alt text is there for browsers with image loading switched off, or where the image fails to load, or for non-visual browsers to read out loud or render in Braille.