
When you build a website, itâs good practice to include alt text (alternative text) with images. Alt text describes images on the web.
To include alt text, you insert an alt
attribute into an HTML image element. An element with an alt
 attribute might look this:
Â
Â
<img src=â/images/cat.jpgâ alt=âOrange cat sleeping on a chairâ />
People with visual impairments may rely on alt text to use your site. Some visually-impaired users use screen readers to access the web. When images have alt text, a screen reader reads that text out loud to the user.
While including alt text is straightforward, writing useful alt text takes a bit of thought.
Ask this question when writing alt text for images
Every time you write alt text, ask yourself, âDo I need to describe what this image does, or do I need to describe what this image is?â
For functional images, write alt text that explains the purpose of the image. For example, imagine youâre building a website for your company, WidgetWonder. WidgetWonderâs logo appears in the navigation menu, and it links to the siteâs home page.
The alt text âWidgetWonder logoâ would accurately describe the logo, but the description isnât helpful to someone using a screen reader. In this case, someone using a screen reader doesnât need to know what the image looks like. She needs to know what the image does. Consider using alt text like âWidgetWonder home pageâ or simply âHome.â This tells her that the logo goes to your siteâs home page. Â
Sometimes, describing what the image does is most important. Other times, itâs more important to describe the image itself. Decorative images can simply be decorative, or they can be part of your siteâs content. When images contain illustrations or photos that give users meaningful information, use alt text to describe whatâs in the images.
Suppose WidgetWonder sells robotics products for elementary school-aged kids. A customer accesses your site with a screen reader. Sheâs shopping for robotics toys for her two children.
Your website displays photos of kids using WidgetWonder products at home. Alt text for these photos could say something like, âTwo kids build a remote-controlled car in their kitchen with WidgetWonder.â This alt text tells the customer whatâs happening in the photo. It also demonstrates how her children can use your product.
Write alt text thatâs useful and accurate
Simply including alt text usually isnât enough to make your images accessible. The alt text has to be useful. For more information about alt text, and to learn more about accessibility, read Virginia DeBoltâs accessibility guide, Accessibility Teaching Resources.
Learning accessibility at Center Centre
Weâve baked accessibility into our program at Center Centre. Students wonât just learn how to write alt text thatâs useful and meaningful to their users. Theyâll learn other things like how to write accessible content and how to observe accessibility needs during user research. During team projects, students will apply what they learn about accessibility to the designs they build.
Become a Center Centre student
Would you like to learn how to make designs that are easy-to-use and accessible? Would you like to graduate from Center Centre as an industry-ready, junior UX designer?  View our full program or apply today. Â