Skip to content

Decorative or Functional Images: Choose the Right Alt Text

Check when to leave alt text empty and when it needs to name an image link. Compare four cases in Chrome’s accessibility tree.

Two matching blue brushstroke prints, one beside paper and one above an arrow
Jack Lee
3 Min Read
Share
On This Page

A course card has a small graphic beside “View the course schedule”. Put the same graphic in a separate link without text and the accessibility result changes. Decide what the image contributes where it is used.

Decide what the image does in this context

Use alt="" when an image is purely decorative. If an image provides information the surrounding text does not convey, write a short equivalent. If it is the only content inside a link, use the alternative text to name the link’s destination or purpose.

When the image sits inside the same link as visible text that already names the destination, an empty alternative can avoid repeating the link name. Nearby text outside the link does not automatically give the link that name. See our WordPress image alt text guide for where to make the edit.

Compare four uses of the same image

SEOWithJack inspected a local page in Chrome with the same image in four contexts. We read each element’s role and computed name from the accessibility tree.

Image contextComputed result
Decoration beside a paragraph, empty altImage ignored by the accessibility tree
Image is the whole link, empty altLink with an empty name
Image is the whole link, alt says “View the course schedule”Link named “View the course schedule”
Decoration and the schedule text are both inside the linkLink named “View the course schedule”

Chrome gave the final two links the same name. The test checked Chrome’s computed accessibility names. It did not run a separate screen reader.

  1. In Chrome DevTools, select the link element in Elements, rather than just its child image. Open Accessibility and check the link’s Name.
  2. If an image-only link has no name, give the image alternative text that describes the link’s purpose. If the same link already has a clear text label and the image adds nothing, keep the decoration’s alt empty.
  3. Check the card on mobile and desktop. A card with a visible title on desktop may render a separate image-only link on mobile. If it is a control that opens a search panel or dialog, see our icon button accessibility check.

Frequently asked questions

Should decorative images have empty alt text?

Yes. Use an explicit empty alt attribute when an image adds no information or function. Recheck if it is the only content in a link.

Is leaving the alt attribute out the same as leaving it empty?

No. An empty attribute explicitly marks the image as having no text alternative in this context. If the attribute is absent, software can fall back to other information, such as a filename.

Describe the destination or action. “View the course schedule” explains the link’s purpose more clearly than “blue calendar graphic”.

Share This Article