Alt attribute: Difference between revisions

Content deleted Content added
→‎History: Making changes per Talk:Alt attribute/GA1 including minor grammar fixes and replacing a reference
Rewording lede
Line 4:
{{short description|Alternative text that appears when a HTML element cannot be rendered}}
{{lowercase|alt attribute}}
The '''alt attribute''' is the [[HTML attribute]] used in [[HTML]] and [[XHTML]] documents to specify alternative [[Plain text|text]] ('''alt text''') that is to be [[renderingdisplayed (computerin graphics)|rendered]]place whenof thean [[HTML element|element]] to which it is appliedthat 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 for accessibility, 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. The use of the alt attribute for images displayed within HTML is part of W3C's [[Web Content Accessibility Guidelines]] (WCAG). [[Screen reader]]s and [[text-based web browser]]s read the alt attribute in place of the image. The text within the alt attribute substitutes the image when [[copy-paste]]d as text and makes images more [[Machine-readable data|machine-readable]], which improves [[search engine optimization]] (SEO).