9.4. Creating Accessible Sites

There are many books on the market that have the luxury of going into extreme detail about creating accessible websites, spending a great deal of time learning why a certain technique is applied. Since this is a book about testing, we are only going to cover the basics of what is required to create and test that a site is accessible.

9.4.1. Working with Images

A picture can say a thousand words, and can allow developers to express complex ideas in a small amount of space. When developers first learn about creating accessible websites, a popular starting point is applying the alternative text attribute to image tags.

9.4.2. When to Add Alternative Text

Standards state that all images should have this attribute, but does it really make sense for all images to have text describing them? The alternative attribute is read by screen readers and is intended to provide an alternative access method for images — simply put, a short description of an image.

It does not make sense for decorative images, such as gradiated backgrounds, spacers, or rounded corners to have alternative text applied to them. When actually testing a site with alternative text applied to decorative images, you will find it is not useful (we are jumping ahead of ourselves here, but we will get there).

When images are used as decorative purposes, it's best to remove the image from the page and add it as a background image using CSS. This technique will remove the need for alternative ...

Get Testing ASP.NET Web Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.