Skip to main content
WCAGrules
Quick navigation

Do not give decorative images junk alt text

F39 is a documented failure under the non-text content rule, and it is F38's mirror. F38 is no alt attribute at all. F39 is an alt attribute with the wrong thing inside it, spacer or image or divider. The correct alternative for an image that should be ignored is an empty one. What counts as ignorable is wider than decorative. It covers decoration, spacing, and any other purpose that is not part of the meaningful content of the page, so tracking pixels, layout shims and analytics beacons all sit inside it and all commonly carry junk. There is a second consequence nobody mentions. In some alternate color schemes, and with images turned off, alt text is displayed rather than announced, so the word spacer becomes visible text on your page.

How we find it in an audit

Automated checks find the classic vocabulary reliably. Spacer, image, photo, divider, bullet. That catches most of it. A reviewer takes the rest, because junk is contextual, and a word like logo is junk on a flourish and correct on a brand mark. We look at what the image is doing too, since the better repair for a one-pixel spacer is deleting it rather than emptying its alt attribute.

How affected users experience it

The published example is the sharpest demonstration there is. A spacer image sits between the words Tree type and Cedrus deodara, and the screen reader says "Tree type spacer Cedrus deodara". The junk did not sit politely at the edge of the sentence. It landed inside it. Multiply that by a page laid out with spacer images and the content is interrupted every few words by a word that means nothing.

Passes vs. fails

Passes: alt text names the product. Fails: the file name is all there is.

Passes

<img src="spacer.gif" alt="">
<!-- Better still, delete the spacer and use a CSS margin. -->

Fails

<img src="spacer.gif" alt="spacer">
<!-- "Tree type spacer Cedrus deodara" -->

How this gets tested

The W3C publishes test rules that define what a checker looks for here.

The other techniques filed under this rule

39 guides on this site are filed under 1.1.1 Non-text Content. W3C documents this one as a failure of that rule, so it describes a way the rule gets broken rather than a way to pass it.

This guide is our interpretation of W3C technique F39: Failure of Success Criterion 1.1.1 due to providing a text alternative that is not null (e.g., alt="spacer" or alt="image") for images that should be ignored by assistive technology. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations