WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: A small doubt on alt text

for

From: Jukka K. Korpela
Date: Feb 18, 2013 1:20AM


2013-02-18 9:42, Ravi Jain wrote:

> In the following example , none of the markups is announcing the "alt" text
> can anybody point out , where i am going wrong in the following example
> Ex:
> <a href="page1.html" label="HS Jacobs - a UAHC camp in Utica,
> MS">Henry S. Jacobs Camp</a>
> <a href="page2.html" aria-label="HS Jacobs - a UAHC camp in Utica,
> MS">Jacobs Camp</a>
> <a href="page3.html" alt="HS Jacobs - a UAHC camp in Utica, MS">Henry
> S. Jacobs Camp</a>
> <a href="page4.html" title="HS Jacobs - a UAHC camp in Utica,
> MS">Henry S. Jacobs Camp</a>
>
> None of the above links is announcing alt text .

A link does not need alt text and cannot have one: the alt attribute on
an <a> element is not valid in any HTML specification and gets ignored
by browsers and search engines.

If the <a> element contained an image (only), then the <img> element -
not the <a> element - would need an alt attribute in order to make the
link meaningful even when the image is not seen.

The title attribute is allowed in an <a> element, and it is usually
displayed in a tooltip popup in graphic browsers and may be made
optionally available by assistive software. But it is not required, and
should not be relied on. It is just a way to give additional hints. Due
to usability and accessibility issues with tooltip implementations, it
has become increasingly common to use "CSS tooltips" instead. This
typically means that the extra text appears in an element after the <a>
element and becomes visible on mouseover. In nonvisual rendering, the
extra text may appear as normal content, or it may not appear at all,
depending on implementation.

The label attribute is invalid and gets ignored on <a> elements.

The aria-label attribute defines a string value that labels the current
element. It is meant for elements, typically controls, that have no
visible label on screen, such as a graphic widget created by
technologies other than a simple <img> element. So I don't think
aria-label would be adequate for an extended or alternate formulation of
a link text - the title attribute is more suitable for that.

Yucca