Skip to main content

HTML Guide

Bad value “presentation” for attribute “role” on element “img”

Use role="none" (or remove the role) instead of role="presentation" on an img.

The role attribute maps elements to ARIA roles. For images, the valid way to make an image decorative is to either omit the ARIA role and use an empty alt attribute (alt=""), or use the ARIA role none. In ARIA 1.1, role="none" and role="presentation" are equivalent, but the W3C HTML Validator flags role="presentation" on img because the correct, accessible pattern is an empty alt to hide the image from assistive tech. Use alt="" alone, or pair it with role="none" if you need an explicit ARIA role. If the image conveys meaning, provide a descriptive alt and no role.

HTML Examples

Example that reproduces the issue

<img src="avatar.png" alt="" role="presentation">

Fixed examples

Decorative image (preferred minimal fix):

<img src="avatar.png" alt="">

Informative image:

<img src="chart.png" alt="Quarterly sales trend line chart">

Learn more:

Related W3C validator issues