Lably
Skip to content

Alt attribute

Alternative text that appears when a HTML element cannot be rendered

  • 5 min read
  • 3 chapters

Related on Lably

Through HTML, World Wide Web and Applet

The alt attribute is used to increase accessibility and user friendliness, including for blind internet users who rely on special software for web browsing. The use of the alt attribute for images displayed within HTML is part of W3C's Web Content Accessibility Guidelines (WCAG). Screen readers and text-based web browsers read the alt attribute in place of the image. The text within the alt attribute substitutes the image when copy-pasted as text and makes images more machine-readable, which improves search engine optimization (SEO).

History

The attribute was first introduced in the HTML 1.2 draft in 1993 to provide support for text-based browsers. In HTML 4.01, which was released in 1999, the attribute was made to be a requirement for the img and area tags. It is optional for the input tag and the deprecated applet tag.

Internet Explorer 7 and earlier render text in alt attributes as tooltip text, which is not compliant with the World Wide Web Consortium (W3C)'s HTML standards. This behavior led many web developers to misuse the alt attribute when they wished to display tooltips containing additional information about images, instead of using the title attribute that was intended for that use. As of Internet Explorer 8, released in 2009, alt attributes no longer render as tooltips on Internet Explorer.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication