E-mail List Archives

Re: alt text on img sources, and best software to inspect html code with a screen reader

for

From: Bryan Garaventa
Date: Oct 31, 2011 9:30AM


Actually if you wanted to provide an image link to sighted users that has no
value or relevance to screen reader users, you could hide it in the
following manner:

<span class="link"><img src="whatever.jpg" alt="" ... /></span>

Then use CSS to style the span like a link and make it clickable. Screen
readers will ignore the image since it has a null alt, keyboard users won't
encounter it since it has no tabindex, and the span won't be recognized by
ATs as an active element.

It's best to make certain that such functionality is totally useless to AT
and keyboard users before doing it though, otherwise you would be
introducing equivalence issues.


----- Original Message -----
From: "Jared Smith" < <EMAIL REMOVED> >
To: "WebAIM Discussion List" < <EMAIL REMOVED> >
Sent: Monday, October 31, 2011 8:08 AM
Subject: Re: [WebAIM] alt text on img sources, and best software to inspect
html code with a screen reader


> On Mon, Oct 31, 2011 at 8:59 AM, Birkir R. Gunnarsson
> < <EMAIL REMOVED> > wrote:
>
>> What would be the correct way to code this link to hide it from screen
>> readers altogether?
>
> You can't. JAWS will always identify links. Sighted users can see
> something and click on it, so JAWS properly identifies this function.
> If there's no alternative text to be read, it will, as you note, read
> the image file name - in this case "e2c1488c83.jpg", which is worse
> than useless.
>
> This link doesn't really provide much utility - it links to the image
> itself. The link could probably be removed. If it remains, the image
> must be given alternative text that describes the content and function
> of the link, probably "larger image of {image content}" or similar.
>
> Jared
>