Why You Should Use The “alt” Attribute

Sep

07

First off, what is the "alt" attribute? Well, the "alt" attribute "is used in HTML documents to specify text which is to be rendered when the element to which it is applied cannot be rendered. In HTML 4.01, the attribute is required for the img and area element types (wikipedia. com)". Even though it is required for img and area elements, many, many developers forget or just plain don't use it. How can we blame them? They know where their images sit, and they know that they will always appear, right? WRONG!!! Here is a perfect example where having the "alt" attribute defined is critical:

E-mail Marketing

Many companies use nicely formatted HTML e-mails with images to inform their potential customers of deals they are offering.

Problem: I use "Thunderbird" for all my personal e-mail accounts. In order to prevent any malicious content from harming your PC, Thunderbird will disable all images that are contained in e-mails until you explicitly allow them to appear (Outlook does this as well).

Take a look at this e-mail I received from Hard Rock Hotel and Casino:

hard rock e-mail with no alt attribute defined.

Notice there the 2 broken images. Hard Rock is trying to inform me of something, yet I have no clue what it is. The question: Is it really worth it for me, after sorting through all my e-mails, to click the "show images" button for this e-mail to actually see the deal?

Now let's take a look at an e-mail from a different company:

Applie i-Tunes e-mail with alt attributes defined.

Notice how there are no empty spaces, or broken images? Each image from this e-mail has an "alt" attribute defined, hence, I understand exactly what is being offered in this e-mail. In fact, by adding these attributes, I may actually be enticed to click the "show images" button to potentially get more information about what's being offered:

i-Tuned e-mail after clicking the show images
button.

I bet, like me, only for the purposes of this article, you are curious as to what the hard rock is offering.

hard rock e-mail after clicking the show images
button.

Wow! Look at all the information contained in that one image. No "alt" attribute = no sale. I never did click on the "show images" button until writing this article, which means I never knew that I could have stayed at the Hard Rock for $79 a night last month. That's a pretty damn good deal too.

No CommentsComments

Leave a Comment