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.
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.
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.
For purely decorative images, or images used to help with the layout of a page, the alt attribute should be empty (alt=”‘).
I provided feedback on the WCAG 2 (as representative of Guild of Accessible Website Designers) have two decades of experience and worked with hundreds of organisations.
07810 098 119