WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Alt Text on Graphic Links

for

Number of posts in this thread: 5 (In chronological order)

From: Heather Mariger
Date: Mon, Apr 27 2020 3:38PM
Subject: Alt Text on Graphic Links
No previous message | Next message →

Greetings,

I have a technical question that is a bit beyond my ken:

We have a website with several graphics that are also links. I noticed that
the graphics do not have alt text and checked with WAVE to be sure.

When we let the developer know, he responded:

> From what I remember regarding Accessibility rules is that if the image is
> surrounded by a Hyperlink, then technically it's in compliance because the
> link tells them where they are going.
>
> If the only purpose the image serves is for display then yes an alt tag is
> required.
>
> So the reason this hadn't been brought up before is because the link had
> been set using CSS background property and the browser never would have
> told them there was an image, because it never saw the tag <img> in the
> html DOM.
>
I did test the site with NVDA and it does list the link and not the graphic
but I want to make sure that we are promoting compliance and best
practices.

So, is the information above correct and if not, do you have any good
suggestions for references for me?

Thanks,
H.

*Heather Mariger*
*Digital Accessibility Advocate*

*Pronouns: She/Her*

*Center for Academic Innovation*
*Chemeketa Community College*
*4000 Lancaster Drive NE - 9/126A*
*Salem, OR 97305*

503.589.7832

*****************
*Diversity is being invited to the party; inclusion is being asked to
dance. *
Verna Myers, author and speaker

From: Patrick H. Lauke
Date: Mon, Apr 27 2020 3:50PM
Subject: Re: Alt Text on Graphic Links
← Previous message | Next message →

Without anything else (a title, aria-label, or similar on the link at
least), this fails 1.1.1 for the image lacking a text alternative, and
the link fails both 2.4.4 for lacking any kind of link text and 4.1.2
for lacking an accessible name.


So no, the developer is talking rubbish. And if the developer seriously
mentions "alt tag" that's a good canary in the coalmine for them not
knowing much of anything.

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Jonathan Avila
Date: Mon, Apr 27 2020 6:35PM
Subject: Re: Alt Text on Graphic Links
← Previous message | Next message →

Hi, it sounds like you are asking if the inline image inside a link is decorative does the image need alt text. The image doesn't need alt text but I'd say you would want to still mark the image as decorative (e.g. alt="", role presentation) -- even though it's not needed it would be important to mark it as decorative to avoid any confusion. This might be different for different constructs -- for example, I'd read the SVG accessiblity mappings document and it seems to indicate that for an SVG as a child of an element like a link or button the SVG could automatically be treated as decorative without a role presentation -- but have not seen such as claim for inline images.

Jonathan

From: glen walker
Date: Tue, Apr 28 2020 8:32AM
Subject: Re: Alt Text on Graphic Links
← Previous message | Next message →

Ignoring WCAG for the moment, the alt attribute is a required attribute.
Period. It's an html parsing error if the attribute does not exist.

From: Jeremy Echols
Date: Tue, Apr 28 2020 8:42AM
Subject: Re: Alt Text on Graphic Links
← Previous message | No next message

Playing devil's advocate for a moment, devs are as imperfect as anybody else, and this may have been a quick response that wasn't worded carefully. And to Glen's point, I often simplify things when talking to non-devs by saying there's "no alt attribute" despite setting it to a blank value.

Reading the response, I think more context is needed to say whether it's a failure, because it kind of sounds like the dev might be describing a situation where there is text in the link, and the graphic is just one piece of the link. I don't think anybody here can really say much about the situation without more context.

The critical question isn't "does the image have a good alt attribute?" The question that matters is "does the link have an accessible label?" That can be satisfied with an image that has an empty alt attribute so long as the "a" element has more in it than just the image.