Alt attribute explained

The alt attribute is the HTML attribute used in HTML and XHTML documents to specify alternative text (alt text) that is to be displayed in place of an element that cannot be rendered. The alt attribute is used for short descriptions, with longer descriptions using the longdesc attribute. The standards organization for the World Wide Web, the World Wide Web Consortium (W3C), recommends that every image displayed through HTML have an alt attribute, though the alt attribute does not need to contain text. The lack of proper alt attributes on website images has led to several accessibility-related lawsuits.

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.[1] In HTML 4.01, which was released in 1999, the attribute was made to be a requirement for the img and area tags.[2] It is optional for the input tag and the deprecated applet tag.[3]

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.[4] 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.[5] [6] As of Internet Explorer 8, released in 2009, alt attributes no longer render as tooltips on Internet Explorer.[7]

Usage

The text in the alt attribute is used to replace the image when the image cannot be loaded, without changing the intended meaning of the page's contents.[8] The W3C's web content accessibility guidelines state that the alt attribute is used to convey the meaning and intent of the image, rather than being a literal description of the image itself.[9] For example, an alt attribute for an image of an institution's logo should convey that it is the institution's logo rather than describing details of what the logo looks like.[10] [11] The alt attribute is intended to be used for short and concise descriptions of the image. Longer descriptions can be given using the longdesc attribute, which provides more detailed information and complements but does not replace the alt attribute.

A screen reader such as Orca will read out the alt text in place of the image.[12] A text-based web browser such as Lynx will display the alt text instead of the image (or will display the value attribute if the image is a clickable button).[13] A graphical browser typically will display only the image, and will display the alt text only if the user views the image's properties, or has configured the browser not to display images, or if the browser was unable to retrieve or to decode the image.[14]

The use of descriptions in the alt attribute improves search engine optimization and allows image-specific search engines, such as Google Images, to search for and display relevant images that are used on websites in search results.[15] For non-image search results, the text within the alt attribute is read by search engines the same way that regular text on the page is read.[16]

The W3C recommends that images that convey no information, but are purely decorative, be specified in CSS rather than in the HTML markup. If decorative images are rendered using HTML that do not add to the content and provide no additional information, then the W3C recommends that a blank alt attribute be included in the form of alt="".[17] This makes the page more navigable for users of screen readers or non-graphical browsers by skipping over images that do not convey any meaning. If no alt attribute has been supplied, then browsers that cannot display the image will not overlook the image but instead will read or display the URL or another identifying marker.[18] This creates ambiguity since the user is generally unable to determine from a bare reading of a URL if the image is relevant to the text or if it is a purely decorative element of the webpage.[19] A 2021 Google Lighthouse audit showed that 27% of alt text attributes audited were empty, despite the fact that the majority of those images were non-decorative informational images.[20]

Lawsuits

There have been many lawsuits over website accessibility and the lack of proper alt attributes on websites. Maguire v Sydney Organising Committee for the Olympic Games was a 2000 lawsuit in which a blind man in Australia sued the Sydney Organising Committee for the Olympic Games because their website www.olympics.com was not accessible to him because of the lack of alt attributes on images.[21] The Australian Human Rights Commission ruled that the website had discriminated against him for failing to conform to accessibility standards that enable blind individuals to navigate websites.[22] During the lawsuit, the Australian commonwealth, state and territory governments issued a joint statement through the Department of Broadband, Communications and the Digital Economy that they were adopting the W3C's accessibility guidelines for all .gov.au websites.[23]

In the United States, there have been several high-profile lawsuits involving the lack of alt attributes on images that cite a violation of the Americans with Disabilities Act (ADA).[24] The United States Department of Justice gives the lack of alt attributes as an example of a barrier to website accessibility.[25] National Federation of the Blind v. Target Corp. was a 2006 class-action lawsuit that alleged that Target.com violated the ADA because the images did not use alt attributes.[26] This lawsuit set a legal precedent in the United States for website accessibility and compliance with the ADA.[27]

External links

Notes and References

  1. Web site: Berners-Lee . Tim . Tim Berners-Lee . Connolly . Daniel . Dan Connolly (computer scientist) . June 1993 . Hypertext Markup Language (HTML) Internet Draft version 1.2 . live . https://web.archive.org/web/20170103041713/https://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt . 3 January 2017 . 18 September 2010 . IETF IIIR Working Group.
  2. Web site: 24 December 1999 . 13 Objects, Images, and Applets . live . https://web.archive.org/web/20080906001213/http://www.w3.org/TR/html401/struct/objects.html#adef-alt . 6 September 2008 . 4 December 2005 . World Wide Web Consortium.
  3. Web site: Hazaël-Massieux . Dominique . 20 November 2002 . Use the alt attribute to describe the function of each visual . live . https://web.archive.org/web/20220320214305/https://www.w3.org/QA/Tips/altAttribute . 20 March 2022 . 14 October 2022 . World Wide Web Consortium.
  4. Web site: Why doesn't Mozilla display my alt tooltips? . dead . https://web.archive.org/web/20081015232141/http://developer.mozilla.org/en/Mozilla_Web_Developer_FAQ#Why_doesn.E2.80.99t_Mozilla_display_my_alt_tooltips.3F . 15 October 2008 . 22 July 2009 . MDN Web Docs.
  5. Web site: Flavell . A.J. . Use of ALT texts in IMGs . live . https://web.archive.org/web/20220108230541/https://www.htmlhelp.com/feature/art3.htm . 8 January 2022 . 16 October 2022 . www.htmlhelp.com.
  6. Web site: W3C HTML WG . 24 December 1999 . 7.4.3 The title attribute . live . https://web.archive.org/web/20090726044334/http://www.w3.org/TR/html4/struct/global.html#h-7.4.3 . 26 July 2009 . 22 July 2009 . HTML 4.01 Specification . W3C.
  7. Web site: What's New in Internet Explorer 8 – Accessibility and ARIA . live . https://web.archive.org/web/20090228115639/http://msdn.microsoft.com/en-us/library/cc288472.aspx . 28 February 2009 . 22 July 2009 . MSDN . Microsoft.
  8. Web site: HTMLImageElement.alt . live . https://web.archive.org/web/20220822212522/https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt . 22 August 2022 . 14 October 2022 . Mozilla.
  9. Web site: Using alt attributes on img elements . live . https://web.archive.org/web/20220516223146/https://www.w3.org/TR/2016/NOTE-WCAG20-TECHS-20161007/H37 . 16 May 2022 . 13 October 2022 . World Wide Web Consortium.
  10. Web site: Logo Alt Text . live . https://web.archive.org/web/20220722213601/https://sc.edu/about/offices_and_divisions/digital-accessibility/guides_tutorials/alternative_text/logo-alt-text/index.php . 22 July 2022 . 15 October 2022 . University of South Carolina.
  11. Web site: Montti . Roger . 2022-11-01 . Google Explains Alt Text for Logos & Buttons . 2022-11-03 . Search Engine Journal . en . 3 November 2022 . https://web.archive.org/web/20221103152738/https://www.searchenginejournal.com/alt-text-for-logos-and-buttons/469801/ . live .
  12. Web site: Hofmann . Frank . Beckert . Axel . 2021 . Text Art: Rendering images as text . live . https://web.archive.org/web/20221015064058/https://www.linux-magazine.com/Online/Features/Converting-Images-to-Text/%28offset%29/3 . 15 October 2022 . 14 October 2022 . Linux Magazine.
  13. Web site: Lynx Users Guide v2.8.9 . live . https://web.archive.org/web/20190204065859/https://lynx.invisible-island.net/lynx_help/Lynx_users_guide.html . 4 February 2019 . 15 October 2022 . lynx.invisible-island.net.
  14. Web site: Image ALT Text . live . https://web.archive.org/web/20221012021810/https://accessibility.psu.edu/images/alttext/ . 12 October 2022 . 14 October 2022 . Pennsylvania State University. 6 October 2014 .
  15. Web site: 20 September 2022 . Google Images best practices . live . https://web.archive.org/web/20221014094659/https://developers.google.com/search/docs/appearance/google-images . 14 October 2022 . 14 October 2022 . Google Developers.
  16. Web site: Southern . Matt G. . 22 March 2022 . Google: Alt Text Only A Factor For Image Search . live . https://web.archive.org/web/20220422141742/https://www.searchenginejournal.com/google-alt-text-only-a-factor-for-image-search/442865/#close . 22 April 2022 . 14 October 2022 . Search Engine Journal .
  17. Web site: W3C . Embedded content – HTML 5 . live . https://web.archive.org/web/20170702051717/http://www.w3.org/TR/html5/embedded-content-0.html#a-purely-decorative-image-that-doesn't-add-any-information . 2 July 2017 . 29 June 2017.
  18. Solovieva . Tatiana I. . Bock . Jeremy M. . 2014 . Monitoring for Accessibility and University Websites: Meeting the Needs of People with Disabilities . live . Journal of Postsecondary Education and Disability . 27 . 2 . 113–127 . https://web.archive.org/web/20221014232614/https://eric.ed.gov/?id=EJ1040525 . 14 October 2022 . 14 October 2022 . Education Resources Information Center.
  19. Curl . Angela L. . Bowers . Deborah D. . 23 April 2009 . A Longitudinal Study of Website Accessibility: Have Social Work Education Websites Become More Accessible? . live . Journal of Technology in Human Services . en . 27 . 2 . 93–105 . 10.1080/15228830902749229 . 2374.MIA/5279 . 143667951 . subscription . https://web.archive.org/web/20221014232615/https://www.tandfonline.com/doi/abs/10.1080/15228830902749229 . 14 October 2022 . 14 October 2022. free .
  20. Web site: Tait . Alex . Davis . Scott . Niyi-Awosusi . Olu . Wilhelm . Gary . Dixon . Carlie . 30 November 2021 . Part II Chapter 9 – Accessibility . 14 October 2022 . Web Almanac by HTTParchive.org.
  21. News: White . Caroline . 2 November 2000 . Battle to be equal . . live . 14 October 2022 . https://web.archive.org/web/20221014084006/https://www.newspapers.com/clip/111280702/battle-to-be-equal/ . 14 October 2022 . Newspapers.com.
  22. Web site: Barkham . Patrick . 30 August 2000 . Website 'discriminated against blind' . live . https://web.archive.org/web/20160823132558/https://www.theguardian.com/technology/2000/aug/30/internetnews.sydney . 23 August 2016 . 14 October 2022 . The Guardian.
  23. Web site: 30 June 2000 . Seventh Ministerial meeting of the Online Council – Media release . dead . https://web.archive.org/web/20130620081938/http://www.dbcde.gov.au/Article/0,,0_4-2_4008-4_15092,00.html . 20 June 2013 . 14 October 2022 . Australian Department of Broadband, Communications and the Digital Economy.
  24. Cohen . Alex H. . Fresneda . Jorge E. . Anderson . Rolph E. . September 2020 . What retailers need to understand about website inaccessibility and disabled consumers: Challenges and opportunities . Journal of Consumer Affairs . en . 54 . 3 . 854–889 . 10.1111/joca.12307 . 225771708 . 0022-0078 . subscription.
  25. Web site: 18 March 2022 . Guidance on Web Accessibility and the ADA . live . https://web.archive.org/web/20221013080830/https://beta.ada.gov/resources/web-guidance/ . 13 October 2022 . 14 October 2022 . ADA.gov.
  26. Web site: Daniels . Linda Markus . 13 September 2006 . Websites for the Blind: Is This The Next 'Year 2000 Compliant' Requirement? . dead . https://web.archive.org/web/20080916100355/http://localtechwire.com/business/local_tech_wire/biotech/story/1167848/ . 16 September 2008 . 14 October 2022 . WRAL-TV.
  27. Book: Frank, Jonathan . Proceedings of the 41st Annual Hawaii International Conference on System Sciences (HICSS 2008) . Web Accessibility for the Blind: Corporate Social Responsibility or Litigation Avoidance? . January 2008 . https://ieeexplore.ieee.org/document/4438989 . live . Waikoloa, HI . IEEE . 284 . 10.1109/HICSS.2008.497 . 16280255 . https://web.archive.org/web/20210308045947/https://ieeexplore.ieee.org/document/4438989/ . 8 March 2021 . 14 October 2022 . subscription.