Accessible alt text for a complex image
A bank comparison graphic with accessibility in mind. These graphics, for legal, have to be presented as-is, but the alt text can become overwhelming and difficult to both understand and maintain.
Example
Text description
Ranking | Bank | How likely to recommend |
---|---|---|
1 | Monzo | 80% |
2 | Starling Bank | 79% |
3 | First Direct | 78% |
4= | Nationwide | 67% |
4= | Metro Bank | 67% | 10 | Santander | 59% |
The code
HTML
CSS
Features
- No JavaScript required.
- No ARIA used.
- Uses semantic HTML, and a little CSS.
- Use a figure element to structually associate a text description to the image.
- The image alt text simply references the text description offered:
alt="Bank comparision - See text description"
. - Use a details / summary element to hide and show the text description in an accessible manner.
- While a data table is used here to represent chart data, other graphics may be better suited to use headings, lists and paragraphs.
- Data table has a descriptive caption.
- Data table headings are marked and scoped.
- Data table is accessible at 200% text size on a mobile device with a 320px width.
- Please avoid stating a width on the data table.
- Please keep text aligned to the left. Icons may be centered, and numbers may be right aligned, if it aids clarity.
- At very large font sizes the table is allowed to scroll horizontally. This is an accessibility feature and should not be removed.