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: Birkir R. Gunnarsson
Date: Aug 23, 2024 3:48AM


aria-label has, I believe, full accessibility support on the <img> element
and is treated just like an alt attribute would be, i.e. it is announced
when a user navigates to the image. In other words, both aria-label and alt
attribute map to the <img> element's accessible name.

So it is sufficient to have aria-label on an <img> in place of an alt.
It is preferred to use native HTML elements and attributes but it is not an
accessibility fail to use the appropriate ARIA attribute in place of an
HTML one, provided it is sufficiently supported by assistive technologies.


On Fri, Aug 23, 2024 at 5:40 AM Jim Byrne Accessible Web Design <
<EMAIL REMOVED> > wrote:

> Hi,
>
> I’m auditing a website that has many crucial image that do not have alt
> attributes. However, they all have aria-label. I see W3C says ‘"The alt
> attribute continues to be the preferred way to provide alternative text for
> images” - which is bit vague.
>
> In the past having no alt attribute would have been a fail - on the
> standards validation test alone. But the validation test is deprecated. So
> - the missing alt attribute no longer a fail?
>
> The ARIA docs say that Aria-label is designed to add additional
> information. I.e., not the primary information expected via the alt
> attribute.
>
> 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?
>
> Thanks,
> Jim
>
>
>
> 
>
> Multi-award-winning WCAG 2.2 AA Accessibility Auditing and Accessibility
> Consultant
>
> Web: https://jimbyrne.co.uk
>
> Jim Byrne is one of the UK’s most experienced practitioners in the area of
> accessible digital design.
>
> Jim provided feedback during the development of WCAG 2 (the de facto
> accessibility guidelines used by governments across the world). He is the
> author of a number of technical books, training courses and accessibility
> guides. Jim was a winner of the equal access category of the Global
> Bangemann Challenge.
>
> > > > >


--
Work hard. Have fun. Make history.