RE: Anchor images - pixel sized & alt text

The error messages you got here says: “Alt text for all img elements used as
source anchors is not empty when there is no other text in the anchor” –
note the last part; it seems the tool’s rule engine thinks there’s no other
text in the anchor. This isn’t the case, tough, as we can see there’s more
text here, but it’s in a <span>. It would be interesting to see if removing
the span tag and having the text as an immediate child would get rid of the
error message. (This might break styling if CSS rules rely on the span being
present, so I’m suggesting this just as a test, not not necessarily as a
fix.) If that’s the case, it’s a bug in the checker, since it should treat
text in a span as textual content.

 

(Note that if the span is styled in CSS to be hidden (eg. display:none),
then this would be inaccessible – I don’t know that many checkers are quite
this sophisticated yet, however – but just pointing out that you can’t
always determine this from the HTML alone.)

 

I’m curious about the use of the image here; these days with good CSS layout
support there’s little or no need for spacer images, so I’m not sure why an
IMG is used at all. The fact that it is given a class suggests is a
placeholder for styling, but in that case a generic DIV or SPAN might work
just as well, and would be less likely to look suspicious from an
accessibility point of view. Might be interesting to check the CSS and see
if anything unusual is being done for the "d_nb_s" class.

 

Brendan.

--

Brendan McKeon / brendan_mckeon@hotmail.com

 

 

From: PJ Mancuso [mailto:pmancuso@uoguelph.ca] 
Sent: Tuesday, July 10, 2012 10:44 AM
To: Philippe Vayssière
Cc: w3c-wai-ig@w3.org
Subject: Re: Anchor images - pixel sized & alt text

 

Here is a snippet of one of them, it does appear to be a link:

<span class="d_nb_ni">
<a href="/d2l/lp/ouHome/defaultHome.d2l">
<img src="/d2l/img/lp/pixel.gif" class="d_nb_s" alt="" />
<span>My Home</span>
</a>
</span>

But like I said the image is 1px, should alt be filled or should the
programmers figure out a diff way for styling content?

Thanks
-PJ



On Tue, Jul 10, 2012 at 12:31 PM, Philippe Vayssière
<philippe@alsacreations.fr> wrote:

Hi,

Could you please provide the HTML code of the enclosing link?
Is this a named anchor :
    <a name="name_attribute_deprecated_but_still_used"
id="name_attribute_deprecated_but_still_used"><img src="path/image.png"
alt=""></a>
or a link to some page :
    <a href="something.php"><img src="path/image.png" alt=""></a>

For example, the Accessiweb checklist, which is based on WCAG 2.0,
excludes "a" elements without an "href" attribute from the links that
should have text (or alternative text) as content :
http://www.braillenet.org/accessibilite/referentiel-aw21-en/index.php#crit-6
-6
(you can follow links to the glossary for more details).


Regards,
Ph. Vayssière


Le 10/07/2012 17:39, PJ Mancuso a écrit :

> Hi everyone,
>
> Wanted to say thanks for the previous help received and that I have
> been making headway auditing the webpages that have been tasked to me.
> Question about anchor images and alt text. I received this as some of
> the known problems:
>

> *Success Criteria 1.1.1 Non-text Content (A)*

>
> Check 7: Image used as anchor is missing valid Alt text.

> <http://achecker.ca/checker/suggestion.php?id=7>
>
> *Repair: *Add Alt text that identifies the purpose or function of the
> image.
>
> /Line 84, Column 13/:

>
> <img src="/jjj/img/lp/pixel.gif" class="d_nb_s" alt="" />
>
> The image itself is 1px and is used as an anchor for a link I believe.
> In this situation is alt text really useful? I have read somewhere
> that in this particular situation anchor images shouldn't even be
> used. What exactly is the proper procedure here?
>
>
> Any explanation would be greatly appreciated so I can pass on to the
> programmers. I hope this wasn't too confusing.
>
>
> Regards,
>
> -PJ
>




 

Received on Tuesday, 10 July 2012 20:42:43 UTC