WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Is using aria-label to add alternative text - but no alt attribute still a WCAG fail?

for

From: Patrick H. Lauke
Date: Aug 23, 2024 3:47AM


On 23/08/2024 10:39, Jim Byrne Accessible Web Design wrote:
> I see W3C says ‘"The alt attribute continues to be the preferred way to provide alternative text for images” - which is bit vague.

Would be helpful to point to where this is said.

> The ARIA docs say that Aria-label is designed to add additional information. I.e., not the primary information expected via the alt attribute.

Where does it say that? looking at
https://w3c.github.io/aria/#aria-label it doesn't give me the impression
that it means "additional information", because that would be incorrect.
aria-label provides the accessible name for an element.

> I’m assuming that having no alt attribute on an image is still a fail - even if ARIA is used to provide the alternative text - and specifically using aria-label instead of the alt attribute. Am I correct?

aria-label provides the accessible name for an image, the same way alt
provides the accessible name. Unless I'm missing a nuance, the two end
up being identical and lead to the exact same end result.

--
Patrick H. Lauke

* https://www.splintered.co.uk/
* https://github.com/patrickhlauke
* https://flickr.com/photos/redux/
* https://mastodon.social/@patrick_h_lauke