Element

img

Error Type

Likely

Guidelines

Requirement

Alt text for all img elements is not placeholder text unless author has confirmed it is correct.

Error

Image has suspicious Alt text (placeholder text).

Short Description

img element cannot have alt attribute value of "nbsp" or "spacer".

Rationale

The alternate (ALT) text for this image is suspicious because it appears to be "placeholder" text.

How To Determine

Question Is the Alt text appropriate for the image?
PASS Alt text is appropriate for the image.
FAIL Alt text is not appropriate for the image.

Steps To Check

Procedure

1. Check each img element and compare its alt attribute value to the list of placeholder values.
2. alt attribute placeholder values are: 'nbsp', 'spacer' and src attribute value (filename).

Expected Result

1. Alt text for all img elements is not placeholder text or user has confirmed that the Alt text is appropriate.

Failed Result

1. Change the alt attribute value or confirm that current value is appropriate for the associated image.

Examples

Pass Examples

img has alt text that does not contain any placeholder text.
<?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 #6 - Negative</title>
</head>
<body>
<p><img src="rex.jpg" alt="Photo of a brown and black cat named Rex."/></p>
</body>
</html>

Fail Examples

img has alt text of 'spacer'.
<?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 #6 - Positive</title>
</head>
<body>
<p><img src="rex.jpg" alt="spacer" width="150" height="105"/></p>
</body>
</html>

English | German | Italiano


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