Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 420
user 9631883 Avatar asked Sep 28 '18 13:09

user 9631883


1 Answers

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

like image 105
Shannon Young Avatar answered Oct 30 '22 22:10

Shannon Young