Techniques for WCAG 2.0

On this page:

-

# F89: Failure of 2.4.4, 2.4.9 and 4.1.2 due to using null alt on an image where the image is the only content in a link

## Applicability

Content that contains links.

This failure relates to:

- Success Criterion 2.4.4 (Link Purpose (In Context))
  - How to Meet 2.4.4 (Link Purpose (In Context))
  - Understanding Success Criterion 2.4.4 (Link Purpose (In Context))
- Success Criterion 2.4.9 (Link Purpose (Link Only))
  - How to Meet 2.4.9 (Link Purpose (Link Only))
  - Understanding Success Criterion 2.4.9 (Link Purpose (Link Only))
- Success Criterion 4.1.2 (Name, Role, Value)
  - How to Meet 4.1.2 (Name, Role, Value)
  - Understanding Success Criterion 4.1.2 (Name, Role, Value)

## User Agent and Assistive Technology Support Notes

Different assistive technologies employ different repair strategies when dealing with links that lack text alternatives. For HTML, they may use the `title` attribute of the anchor, if present, or they may use the value of the `src` attribute of the `img` element.

## Description

This failure condition occurs when a link contains only non-text content, such as an image, and the non-text content has been implemented in a way that it can be ignored by assistive technology. Because a link is an interactive control, the user can tab to it and activate it. Since there is no text content within the link to be used as the name, assistive technology employs a variety of repair techniques to find some name to use for the link.

Often, both text and images are used on a page to link to the same target. This introduces a "stuttering" effect when two nearly links have the same name, and authors attempts to eliminate the redundancy by providing a null alt attribute for the image. Unfortuneately, this often makes the problem worse. H2: Combining adjacent image and text links for the same resource (HTML) is the recommended approach to reduce the number of separate links and the undesirable redundancy.

## Examples

### Failure Example 1: HTML Search Results

A search site returns search results that include both a text link and an image link to the match site. The image has a null `alt` attribute, since the result already contains a link with a text description. However, the screen reader does not ignore the image link but uses heuristics to find some text that might describe the purpose of the link. For example, the screen reader might announce, "football dot gif Football Scorecard."

Example Code:

     <a href="scores.html">
       <img src="football.gif" alt="" />
     </a>
     <a href="scores.html">
       Football Scoreboard
     </a>
    }

## Resources

Resources are for information purposes only, no endorsement implied.

- Appropriate Use of Alternative Text, Functional Images

- Text Alternatives for Images (alt-text)

## Related Techniques

- H2: Combining adjacent image and text links for the same resource
- H30: Providing link text that describes the purpose of a link for anchor elements

## Tests

### Procedure

1. Check whether the link contains only non-text content.

2. Check whether the non-text content has been implemented in a way that it can be ignored by assistive technology.

### Expected Results

- If all checks are true, then this failure condition applies and the content fails the success criteria.

- Top
- Contents
- Intro
- Previous: Failure F88
- Next: References