Latest Tweet
- Dropped container of polynesian sauce on floor, fully-open side down. NOTHING CAME OUT. Chick-fil-A, champion of viscous sauces. 14 hrs ago
- More updates...
Categories
Tags
academia alcohol animals boyfriend cooking databases email forwards family Flickr food friends health Javascript Lexington Linux list Mario math movies music news OS X Perl PHP politics programming quizzes Rails rants reading Ruby screenshots shopping Sims sports themes tutorials Twilight is ridiculous vehicles video games videos weather Web development work zombies again-
Recent Comments
-
Random Quote
Cowards die many times before their deaths, The valiant never taste of death but once.
— William Shakespeare Syndication
All posts RSS feed
the alt attribute
Each time that you use
<img>or<area>, you should include the alt attribute. An alt attribute is generally a short description of what the<img>or<area>contains or is pertaining to.Example
<img src="frog.jpg" alt="My pet frog, Snooky.">Why Should I Care?
It’s an easy bit of code to throw in and yet it’s quite helpful. Here’s why:
Basically, if you want to make your web site as widely accessible as possible, you want alt attributes.
Make Them Worthwhile
So many times I’ve gone to a site, viewed the source, and have seen that the owner used alt attributes, but that they were pretty worthless. If you have a big photo of Natalie Portman as part of your layout, don’t just stick in an empty alt attribute so that your site will validate. It’s a cheap way of being able to brag, “Whee, I have valid code!” and it isn’t helping anybody. In your alt attribute, stick a short description, a title, something related to your image or
<area>.Further Reading
More information can be found in the W3C’s Use the alt attribute article as well as in Web Pages That Suck’s Google Is God, Don’t Piss Her Off article.