Skip to main content

Avatars and alt text

Posted in Accessibility

I really enjoyed Nicolas Steenhout’s recent article on Alt text for avatars or user photos. He highlights the importance of ensuring users are provided with the same information visually and non-visually via HTML, saying:

User photos and avatars are informational images. Do use clear and concise alternate text to describe them. Otherwise blind screen reader users won’t have access to the same information as sighted people.

Agreed! So why am I writing this? Well, there is a context in which user avatars should be:

  • presented visually
  • hidden from assistive technology like screen reader software

Where I work there are lots of lists; some present bank transactions, some payslips, and some present people. Many of those lists of people include their avatar photo, which is a great visual hooks for people glancing through the list. But is it useful to convey the same information to blind screen reader users?

As long as the avatars sit alongside the person’s name and a bunch of other information, all of which is enough to identify the person, I’d say the description of the person is superfluous.

A blind screen reader user should get the same experience as a sighted user: fly through that list to quickly identify each person until they land on the one they’re after. But if they get exactly the same content it could be a worse experience.

So, in this context, I’d use an empty ‘alt’ tag for each image, like this:

<li>
<img src="martin-underhill.jpg" alt="" />
<span class="name">Martin Underhill</span>
<!-- Rest of the information -->
</li>

The alternative would be unnecessary information in our context:

<li>
<img src="martin-underhill.jpg" alt="A friendly looking man with a bald head, beard, and glasses." />
<span class="name">Martin Underhill</span>
<!-- Rest of the information -->
</li>

Of course, as Nicolas says, describe the avatar photos in other places, like each person’s profile page. But, just as an icon that is paired with some text can provide a visual hook only and should be hidden from assistive technology, a user avatar or photo is sometimes only for sighted users.

Accessibility in your inbox

I send an accessibility-centric newsletter on the last day of every month, containing:

  • A roundup of the articles I’ve posted
  • A hot pick from my archives
  • Some interesting posts from around the web

I don’t collect any data on when, where or if people open the emails I send them. Your email will only be used to send you newsletters and will never be passed on. You can unsubscribe at any time.

More posts

Here are a couple more posts for you to enjoy. If that’s not enough, have a look at the full list.

  1. Upgrading from iPhone 13 mini to 16 Pro

    I get a new phone every 3-ish years, give mine to my wife, and now she gives hers to our daughter. I got a 16 Pro this year! Here’s the skinny.

  2. Apple, you’re doing the Dynamic Island wrong

    I love the idea of Dynamic Island; making lemons into lemonade and all that. But, in my opinion, Apple have got the fundamentals mixed up.