Element

img

Error Type

Potential

Guidelines

Requirement

Alt text for all img elements used as source anchors identifies the destination of the link.

Error

Alt text may not identify the link destination.

Short Description

img element that is contained by an a (anchor) element must have Alt text that identifies the link destination.

How To Determine

Question Does the Alt text for this image identify the link destination.
PASS Alt text identifies the link destination.
FAIL Alt text does not identify the link destination.

Steps To Check

Procedure

1. Check each img element that is contained by a source a (anchor) element.
2. Check the alt attribute value and the a (anchor) destination.

Expected Result

1. Alt text for all img elements used as source anchors identifies the destination of the link.

Failed Result

1. Change the Alt text so it identifies the destination of the link.

Examples

Pass Examples

Alt text for an image used as a link identifies the destination of the link.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>OAC Testfile - Check #15 - Negative</title>
</head>
<body>
<p><a href="routes.html"><img src="topo.gif" alt="Current routes at Boulders Climbing Gym" /></a></p>
</body>
</html>

Fail Examples

Alt text for an image used as a link does not identify the destination of the link.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>OAC Testfile - Check #15 - Positive</title>
</head>
<body>
<p><a href="routes.html"><img src="topo.gif" alt="large rock with arrow" /></a></p>
</body>
</html>
Web site engine's code is copyright © 2023
Inclusive Design Institute