Search code examples
htmlimageaccessibility

role="presentation" or aria-hidden="true" for decorative images?


Which is semantically better, alt="", role="presentation", CSS bg image or aria-hidden="true" for hiding decorative images from assistive technologies?


Solution

  • The best thing is to use blank alt text.

    <img src="squiggle.gif" width="20" height="20" alt="" />
    

    Using null alt text and no title attribute on img elements for images that AT (Assistive Technology) should ignore.

    - source