Web ACCESSIBILITY Terms & DefInItIons

Alt Tag - Alt text

Definition

An Alt Tag, formally known as alternative text (alt text), is an HTML attribute used in web pages to provide a descriptive text equivalent for non-text content, most commonly images. Its purpose is to describe the image's content and function to users who cannot see it, ensuring accessibility and conveying information effectively.

Explanation

Imagine a scenario where a screen reader, a crucial assistive technology, is diligently reading out the content of a web page to a visually impaired user. As it navigates through the text, it suddenly encounters an image. At this point, a fundamental question arises: how can a machine "read" or interpret a visual image? Without specific instructions, it cannot. This is precisely where the alt tag (or alt text) plays its vital role.

Let's say your web page features a visually striking image of the Taj Mahal. As the screen reader's virtual cursor reaches this image, instead of silently skipping over it, it would announce something like: "An aerial view of the Taj Mahal at sunrise." This verbal description is made possible because this specific descriptive text has been meticulously assigned to the image within the website's underlying HTML code. This method of providing textual alternatives for visual content is technically referred to as "alternative tagging." By implementing proper alt text, you ensure that users relying on screen readers or other assistive technologies do not miss any valuable information conveyed through images, photographs, charts, or other non-text elements on the screen. It integrates the visual information into the auditory or tactile experience of the user.

Example of Alt Tag in HTML:

<img

src="taj-mahal.png"
alt="An aerial view of the Taj Mahal bathed in the light of an early morning sunrise."
title="The iconic Taj Mahal mausoleum in Agra, India, from a unique overhead perspective."

/>

In this example:

  • src="taj-mahal.png" is the path to the image file.
  • alt="An aerial view of the Taj Mahal bathed in the light of an early morning sunrise." is the alternative text. This is what a screen reader would announce. It should be concise yet descriptive, conveying the image's purpose and content.
  • title="The iconic Taj Mahal mausoleum in Agra, India, from a unique overhead perspective." (optional) provides additional context that might be displayed as a tooltip on hover for sighted users, but is not primarily for accessibility purposes.

Properly implemented alt text is a cornerstone of web accessibility, making visual content truly accessible to everyone. It's also beneficial for Search Engine Optimization (SEO) as search engines use alt text to understand image content.

Back to accessibility library

Meet the complete accessibility solution by Corpowid
Easy to install and fully customizable, our intelligent solution delivers flawless accessibility on mobile and desktop. Improve usability, boost SEO, and stay compliant — all with one powerful tool.

Start your free trial now
×