Accessibility: Alternative text #11520
Labels
bug
Fixes for quality problems that affect the customer experience
Project:Accessibility
Team:Platform-Design
Team Label for Kibana Design Team. Support the Analyze group of plugins.
Problem
Every
<img>
element should include analt
attribute that conveys the content or function of the image to screen reader users. If the image is decorative, or if the alternative text for the image is provided in nearby text, then the image should be given 'null' alternative text (alt=""
).Note:
alt
andtitle
have a tendency to be used interchangeably. We should never usetitle
(https://www.paciellogroup.com/blog/2012/01/html5-accessibility-chops-title-attribute-use-and-abuse/).Aria-label
There are a number of places where aria-label is used to provide alternative text, and other places it could be used to provide alternative text (e.g., icon fonts). Great care must be used with
aria-label
because it can override other content. If it is used with a link that has descriptive text as well as an icon, the ARIA label will override the link text. Whenever ARIA is used, the results must always be tested in a screen reader.SVGs, e.g. charts
Our charts use
<svg>
. These elements need alternative text. While you can give SVG elements alternative text, browsers and screen readers do not read it consistently. The most consistent method to provide alternative text is with the<title>
element (not to be confused with thetitle
attribute),role="img"
andaria-labelldedby
(see http://examples.anysurfer.be/svg/ for this technique). However, even this has its limitations—alternative text is not presented in Firefox. See http://www.sitepoint.com/tips-accessible-svg/ for more information about SVG.Note that
<img>
elements that use SVG (<img src="[filename].svg>
) should be given alternative text using thealt
attribute.Audit
<img
and make sure they havealt
attributes.title=
and remove all instances of title attributes (be careful -- make sure that this attribute isn't being used by a directive). Usealt
andaria-label
instead.aria-label
,ariaLabel
,aria-labelledby
,ariaLabelledby
,aria-describedby
, andariaDescribedby
and make sure they're being used correctly.aria-label
to denote any icon that is used without a label.aria-hidden="true"
to hide any icon that is used with a label.svg
and make sure they're accessible.Relevant resources
The text was updated successfully, but these errors were encountered: