Wikipedia:Manual of Style/Accessibility/Alternative text for images

Alternative text (or alt text) is text associated with an image that serves the same purpose and conveys the same essential information as the image.[1] In situations where the image is not available to the reader, perhaps because they have turned off images in their web browser or are using a screen reader due to a visual impairment, the alternative text ensures that no information or functionality is lost.[1] Absent or unhelpful alternative text can be a source of frustration for visually impaired users.[2]

On Wikipedia, alternative text is typically supplied through a combination of the image caption and the text supplied for the image alt parameter in the MediaWiki markup. The following example produces the adjacent image:

Painting of Napoleon Bonaparte in His Study at the Tuileries
The Emperor Napoleon in His Study at the Tuileries by Jacques-Louis David
[[File:Jacques-Louis David 017.jpg |thumb |upright=0.75 |alt=Painting of Napoleon Bonaparte in His Study at the Tuileries |''[[The Emperor Napoleon in His Study at the Tuileries]]'' by [[Jacques-Louis David]]]]

The alt parameter text ("Painting of Napoleon Bonaparte in His Study at the Tuileries") is not normally visible to readers; however, it may be displayed by web browsers when images are switched off, or read out loud by screen readers for those with visual impairment, and can be used by search engines to determine the content of the image.[3] In keeping with other Internet guidelines, the term "alt text" (in a code font) is used here to refer to the text supplied for the image alt parameter and which generates text for the HTML alt attribute; the term "alternative text" refers to the text equivalent for an image, regardless of where that text resides.[4]

For images that link to their image description page (which is nearly all images on Wikipedia), the alt text cannot be blank nor should the alt parameter be absent. This is because a screen reader, in order to describe the purpose of the link, will default to reading out the image filename when no alt text is available.[5] This is usually not helpful. In the above Napoleon example, the screen reader would have read out "link graphic slash Jacques hyphen Louis underscore David underscore zero one seven" had we not supplied the alt parameter.[6]

An image that is purely decorative (provides no information and serves only an aesthetic purpose) requires no alternative text. Often the caption fully meets the requirements for alternative text. However, the only situation where blank alt text is acceptable is where such images are unlinked, which is rarely possible. One solution is to provide something at least minimally useful such as |alt=photograph , |alt=painting, or |alt=sculpture. Another solution, if a caption doesn't already describe or identify the image, is for the alt text to do so as briefly as possible.

  1. ^ a b Cite error: The named reference G94 was invoked but never defined (see the help page).
  2. ^ Cite error: The named reference Lazar2007 was invoked but never defined (see the help page).
  3. ^ Cite error: The named reference WebAIM was invoked but never defined (see the help page).
  4. ^ G74: Providing a long description in text near the non-text content, with a reference to the location of the long description in the short description, WCAG 2.0 technique.
    WebAim writes: "[T]he alt attribute (sometimes called the alt tag, though technically this is incorrect) is not the only mechanism for providing the content and function of the image. This information can also be provided in text adjacent to the image or within the page containing the image. ... The term alternative text, as used in this article, refers to the text equivalent for an image, regardless of where that text resides. It does not refer solely to the alt attribute of the image tag. See WebAIM. Alternative Text Basics, accessed 30 September 2020.
  5. ^ W3C. F89: Failure (...) due to using null alt on an image where the image is the only content in a link, Techniques for WCAG 2.0, accessed November 5, 2014
  6. ^ WebAIM says: "An image that is the only thing inside a link must never have a missing or null alt attribute. This is because the screen reader must read SOMETHING to identify the link." See WebAIM, Context is Everything, accessed 30 September 2020.

From Wikipedia, the free encyclopedia · View on Wikipedia

Developed by Nelliwinne