PDA

View Full Version : Validating Null Images


logictrap
07-23-2008, 08:15 PM
When I validate pages it always complains about the missing alt attribute for images.

What's the recommended way to handle images that don't need an alt attribute because they are filler or other non-essential items?

jcdevelopment
07-23-2008, 08:56 PM
try just placing this in them

alt=""

BoldUlysses
07-23-2008, 09:03 PM
Why would you have "filler" images unless you're using tables for layout and need spacer gifs? Adding alts is good web practice. Even background images and banners can be labeled "background" and "banner" and so on. In IE the alts pop up (incorrectly) as tooltips; if you want to disable this give the image an empty title value:

<img src="image.jpg" alt="Image" title="" />

logictrap
07-23-2008, 09:30 PM
Thanks - I'll give it try.

logictrap
07-23-2008, 09:34 PM
Thanks, I didn't know the title attribute would do that.

To keep images small I sometimes break them up into pieces and can end up with a few pieces and it seems redundant to use an alt attribute.

Candygirl
07-23-2008, 10:48 PM
Even background images and banners can be labeled "background" and "banner" and so on.
I disagree with this. "Background" or "banner" brings no interesting information and should be avoid. If the banner vehicles an information, the "alt" needs to be more descriptive and give this information. If it's just a decoration it's place should be in the css, as background, or, if not possible, the alt should be empty, as w3c recommends (http://www.w3.org/TR/html401/struct/objects.html#h-13.8):
Do not specify irrelevant alternate text when including images intended to format a page, for instance, alt="red ball" would be inappropriate for an image that adds a red ball for decorating a heading or paragraph. In such cases, the alternate text should be the empty string (""). Authors are in any case advised to avoid using images to format pages; style sheets should be used instead.