Blog Post RSS ?

Blogs » JavaScript & CSS » Blank alt attributes
 

Blank alt attributes

by Simon Willison

Roger Johansson has a published a short discussion of the alt and title attributes for images. One point he mentions that I think deserves emphasis is the importance of the blank alt attribute. When checking a page’s accessibility, many people attempt to add a descriptive alt attribute to every image on a page. This really isn’t necessary, and could in fact harm the accessibility of the page! On most sites, many of the images on the page exist for purely decorative purposes; the content would still make perfect sense if the images were removed. These images should have a blank alt attribute, to prevent their display in text or speech browsers.

A pleasant side-effect of moving to CSS based web design is that decorative images tend to end up as CSS background images, rather than inline images in the document. This is certainly the preferred approach, but if a decorative image needs to be included inline but makes no contribution to the underlying content its alt attribute should be left blank. My piece on Writing good ALT text has further tips on this, one of the trickier aspects of web accessibility.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Ping.fm
  • Twitthis

Related posts:

  1. The Decorative Typeface In the last of the series on typeface categories, Jennifer...
  2. Practical Accessibility Tips with WCAG 2.0 Techniques for Web Content Accessibility Guidelines 2.0 is a very...
  3. How to Override Inline CSS Styles Inline CSS can be applied to any HTML element using...
  4. Why The data: URI Scheme Could Help Save Your Slow Site Slow page loads getting you down? The data: URI scheme...
  5. De-clutter the Web With the Readability Bookmarklet Are you fed up with web page widgets, promotions, adverts,...

This post has 10 responses so far

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Follow SitePoint on...