Archive for June, 2006

Usability of an invalid image

Jun 16 2006

When you’re using an image as data and not as just a design part, you should use the (X)HTML image tag. Everyone who has even a little of knowledge of a making a web page knows that. You should also set the alt attribute, that is required in XHTML and which should contain a text alternative of what the image represents.

Nothing exceptional thusfar. But what happens when the image is invalid and can’t be displayed, or when the image isn’t found/accesible (access denied for example)?

The results are different between browsers. Have a look at this invalid image test page in different browsers like Firefox and Internet Explorer.

In Firefox you’ll see nothing, as if nothing is wrong. For the image where the alt attribute is actually containing something, you’ll see that alternate text, but it might as well been normal text, no way to separate it from normal text.
In Internet Explorer on the other hand, you’ll see the all known not available image: Image not available image.. Even when with the alternate attribute containing content, you still see that there is actually an image that is not available.

I’m a big Firefox advocate, but I must admit in this case, Internet Explorer is correct in my opinion. Since the image tag is for content and not for layout, you should see when there is a problem with the content, just as you’ll get an 404 error when your page is not found.