Images – Accessibility Guidelines
Accessibility
18F
GSA
Table of Contents
When using images on a page, you must provide an alternate method for that content. This can be provided in multiple ways. You can provide this information with a caption, alt attribute (alt tag), title attribute, or aria-label attribute. If an image has text, all the text in the image must be provided in the alternate content. No matter which method is used, an alt or title attribute must be provided, even if the attribute is blank.
Testing>
Testing #
- Using the web developer tool, select images > Display Alt Attributes & Outline All Images.
- Inspect each
altattribute for the following:- A unique description of the image is provided
- Repeated images used for controls, status indicators, or other programmatic elements have consistent
alttext - Text included in the image should be included in the
altwhen they are important to understanding the image - Note:
DHS Trusted Tester requires all text in an image be included in the
altattribute * “Image of” or “Photo of” is not used * If thealtattribute is empty, ensure the image is purely decorative - If the image is not decorative, make sure the image is described on the page
- Check outlined images without
altattribute by doing the following:- Right click the image
- Select ‘Inspect Element’
- Check for a title attribute for the information normally found on the
altattribute