Labels should be added to all non-text content; the alt attribute is a requirement for both HTML 4 and XHTML W3C standards based documents.

When trying to decide on the text label required for a particular non-text element, I find it helps to think of them as (roughly) falling into one of three categories: functional, decorative (including layout), or providing content.

Functional

For functional images, including navigation bars (and horizontal rules) the text should describe the function or destination. For example, if an image is used as a search button, the alt attribute could be ‘Search’, if an image is used for navigation the alt attribute should describe the destination. Usually the alt attribute for functional images contains the same text as appears on the graphic button or navigation bar.

Providing content

For images that contain important content, the alt attribute should provide a short description of the content (a few words that sums up the content). Use the title or longdesc attributes for longer descriptions.

Decorative including layout images (e.g. single pixel gifs)

For purely decorative images, or images used to help with the layout of a page, the alt attribute should be empty (alt=”‘).

Related Content

Take my Web Accessibility Online Training Course - WCAG 2.1 Compliance

Learn to design and manage WCAG compliant, accessible websites with my online course

You will learn both the techniques of accessible website design and an entire ‘framework for thinking about the subject’. It will equip you with the skills to understand, identify and fix issues any accessibility issues you come across. Watch the free videos to get a taste of what is on the course. Video image from Web Accessibility Online Training Course - WCAG 2.1 Compliance

Working with non-profits, charities, voluntary and public sector organisations and social enterprises for over 20 years. Jim set up one of the worlds first website accessibility web agencies in the mid 1990s.