alt attribute
HTML |
---|
Comparisons |
The alt attribute is the
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
History
The attribute was first introduced in the HTML 1.2 draft in 1993 to provide support for text-based browsers.
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.[2]
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
Lawsuits
There have been many lawsuits over website accessibility and the lack of proper alt attributes on websites.
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
References
- ^ Berners-Lee, Tim; Connolly, Daniel (June 1993). "Hypertext Markup Language (HTML) Internet Draft version 1.2". IETF IIIR Working Group. Archived from the original on 3 January 2017. Retrieved 18 September 2010.
- ^ a b "13 Objects, Images, and Applets". World Wide Web Consortium. 24 December 1999. Archived from the original on 6 September 2008. Retrieved 4 December 2005.
- ^ Hazaël-Massieux, Dominique (20 November 2002). "Use the alt attribute to describe the function of each visual". World Wide Web Consortium. Archived from the original on 20 March 2022. Retrieved 14 October 2022.
- ^ "Why doesn't Mozilla display my alt tooltips?". MDN Web Docs. Archived from the original on 15 October 2008. Retrieved 22 July 2009.
- ^ Flavell, A.J. "Use of ALT texts in IMGs". www.htmlhelp.com. Archived from the original on 8 January 2022. Retrieved 16 October 2022.
- ^ W3C HTML WG (24 December 1999). "7.4.3 The title attribute". HTML 4.01 Specification. W3C. Archived from the original on 26 July 2009. Retrieved 22 July 2009.
{{cite web}}
: CS1 maint: numeric names: authors list (link) - ^ "What's New in Internet Explorer 8 – Accessibility and ARIA". MSDN. Microsoft. Archived from the original on 28 February 2009. Retrieved 22 July 2009.
- ^ "HTMLImageElement.alt". Mozilla. Archived from the original on 22 August 2022. Retrieved 14 October 2022.
- ^ "Using alt attributes on img elements". World Wide Web Consortium. Archived from the original on 16 May 2022. Retrieved 13 October 2022.
- ^ "Logo Alt Text". University of South Carolina. Archived from the original on 22 July 2022. Retrieved 15 October 2022.
- ^ Montti, Roger (1 November 2022). "Google Explains Alt Text for Logos & Buttons". Search Engine Journal. Archived from the original on 3 November 2022. Retrieved 3 November 2022.
- ^ Hofmann, Frank; Beckert, Axel (2021). "Text Art: Rendering images as text". Linux Magazine. Archived from the original on 15 October 2022. Retrieved 14 October 2022.
- ^ "Lynx Users Guide v2.8.9". lynx.invisible-island.net. Archived from the original on 4 February 2019. Retrieved 15 October 2022.
- ^ "Image ALT Text". Pennsylvania State University. 6 October 2014. Archived from the original on 12 October 2022. Retrieved 14 October 2022.
- ^ "Google Images best practices". Google Developers. 20 September 2022. Archived from the original on 14 October 2022. Retrieved 14 October 2022.
- ^ Southern, Matt G. (22 March 2022). "Google: Alt Text Only A Factor For Image Search". Search Engine Journal. Archived from the original on 22 April 2022. Retrieved 14 October 2022.
- ^ "Embedded content – HTML 5". W3C. Archived from the original on 2 July 2017. Retrieved 29 June 2017.
- ^ a b Solovieva, Tatiana I.; Bock, Jeremy M. (2014). "Monitoring for Accessibility and University Websites: Meeting the Needs of People with Disabilities". Journal of Postsecondary Education and Disability. 27 (2): 113–127. Archived from the original on 14 October 2022. Retrieved 14 October 2022 – via Education Resources Information Center.
- from the original on 14 October 2022. Retrieved 14 October 2022.
- ^ Tait, Alex; Davis, Scott; Niyi-Awosusi, Olu; Wilhelm, Gary; Dixon, Carlie (30 November 2021). "Part II Chapter 9 – Accessibility". Web Almanac by HTTParchive.org. Retrieved 14 October 2022.
- Newspapers.com.
- ^ Barkham, Patrick (30 August 2000). "Website 'discriminated against blind'". The Guardian. Archived from the original on 23 August 2016. Retrieved 14 October 2022.
- ^ "Seventh Ministerial meeting of the Online Council – Media release". Australian Department of Broadband, Communications and the Digital Economy. 30 June 2000. Archived from the original on 20 June 2013. Retrieved 14 October 2022.
- S2CID 225771708.
- ^ "Guidance on Web Accessibility and the ADA". ADA.gov. 18 March 2022. Archived from the original on 13 October 2022. Retrieved 14 October 2022.
- ^ Daniels, Linda Markus (13 September 2006). "Websites for the Blind: Is This The Next 'Year 2000 Compliant' Requirement?". WRAL-TV. Archived from the original on 16 September 2008. Retrieved 14 October 2022.
- from the original on 8 March 2021. Retrieved 14 October 2022.