Monday, June 7, 2010

Alt Text

(I meant to remark on this in my "random musings" post last week, but it slipped my mind.)

You know, there's a right way and a wrong way to do "alt text." And I'm not referring to well-written and clever jokes versus not-so-clever jokes.

"Alt text" is short for "alternate text," and is used by certain browsers to help (for example) vision-impaired Internet users to understand the content of a web page without the help of the images themselves.

That's right, technically speaking, using alt text for funny captions is bad web design and cruel to blind people. You stink for doing it. I know I'm guilty of same, but at least I try to correct it with proper coding. For instance:

Sad spaceship needs Prozac.WRONG. This uses the "alt" tag for its funny caption. (Aside from the issue with the aforementioned browsers, Firefox doesn't display this text if you mouse over it. For those, like me, who use Firefox, this caption is "Sad spaceship needs Prozac." Look here for where I first used this picture.)

RIGHT. (Or at least, not hosing people with disabilities.) This uses the "title" tag for its funny caption.

Here is the correct way to use "alt" text:

Panel from 'Beware the Human Meteorites,' featuring the titular 'Human Meteorites,' which in appearance and to some degree behavior resemble flaming space zombies.For Firefox users: "Panel from 'Beware the Human Meteorites,' featuring the titular 'Human Meteorites,' which in appearance and to some degree behavior resemble flaming space zombies."

I don't claim that my site is particularly friendly to the full range of Internet users, but I would suppose that, if I was trying to be user-friendly to people who use that kind of browser, I'd code my pictures like this:

Panel from 'Beware the Human Meteorites,' featuring the titular 'Human Meteorites,' which in appearance and to some degree behavior resemble flaming space zombies.Note that in IE, that has only its "title" text showing-the "alt" text is reserved for other purposes.

Anyway, just thought I would mention that, so that people who do the kind of thing I do will use "alt" correctly and "title" more correctly for more reasons than simply Firefox/non-IE compatibility issues.

-Signing off.

No comments: