Element

img

Error Type

Potential

Guidelines

Requirement

Alt text for all img elements contains all text in the image unless the image text is decorative or appears elsewhere in the document.

Error

Image may contain text that is not in Alt text.

Short Description

This error is generated for all img elements that have a width and height greater than 50.

How To Determine

Question Is any text within the image also in the Alt text (unless text is decorative or redundant)?
PASS Any text in image is also in Alt text or text in image is decorative or redundant.
FAIL Image contains some text that is not in Alt text.

Steps To Check

Procedure

1. For each img element in the document, check if the associated image contains any text.
2. If the image contains text, check if the text is decorative.
3. Note: For this document, "decorative" is defined as "content that does not provide information, functionality, sensory experience and is neither multimedia nor time-dependent interactive".
4. If the text is not decorative, check if the text appears in the longdesc attribute or elsewhere in the document content.

Expected Result

1. Alt text for all img elements contains all text in the image unless the image text is decorative or appears elsewhere in the content.

Failed Result

1. Modify the alt attribute value so it contains any text within the image.

Examples

Pass Examples

Alt text has all text within image.
<?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>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
<title>OAC Testfile - Check #11 - Negative</title>
</head>
<body>
<p><img src="http://www.freeiconsweb.com/Bookmark/su.png" alt="W3C Working Draft logo"/></p>
</body>
</html>

Fail Examples

Alt text does not contain all text in image.
<?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>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
<title>OAC Testfile - Check #11 - Positive</title>
</head>
<body>
<p><img src="http://www.w3.org/2005/11/MWI-Icons/MWI-Picto.png" alt="logo" /></p>
</body>
</html>

English | German | Italiano


Web site engine's code is copyright © 2011
Inclusive Design Institute
Web Service API