Latest Tweet
- Remember folks: the blue mini neon sour gummi worms are best. 2 weeks ago
- More updates...
Categories
Tags
academia alcohol animals boyfriend cooking databases email forwards family Flickr food friends health Lexington Linux list Mario math movies music news OS X Perl photos 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
There are only two kinds of programming languages: those people always bitch about and those nobody uses.
— Bjarne Stroustrup 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.