Fandom

Ice Hockey Wiki

Alt attribute

54,153pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

The alt attribute is used in HTML and XHTML documents to specify alternative text (alt text) that is to be rendered when the element to which it is applied cannot be rendered. In HTML 4.01, the attribute is required for the img and area tags. It is optional for the input tag and the deprecated applet tag.

The syntax of the alt attribute is:

<img alt="...">
<area alt="...">

or

<input alt="...">

ExampleEdit

Here is an image whose alt attribute is "In the sky flies a red flag with a white cross whose vertical bar is shifted toward the flagpole."

In the sky flies a red flag with a white cross whose vertical bar is shifted toward the flagpole.

The HTML for this image might be something like the following:

<img alt="In the sky flies a red flag with a white cross whose vertical bar is shifted toward the flagpole."
     src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Dannebrog.jpg/180px-Dannebrog.jpg"
     width="180" height="135" />

A visually impaired reader, who is using a screen reader such as JAWS or Orca, will hear the alt text in place of the image. A text browser such as Lynx will display the alt text instead of the image. A graphical browser typically will display only the image, and will display the alt text only if you ask it to show the image's properties. Many graphical browsers can be configured to show the alt text instead of the image.

Common misconceptionsEdit

Internet Explorer 7 and earlier incorrectly renders text in alt attributes as tooltip text.[1][2] This behavior led many web developers to use alt to display tooltips on webpages,[3] instead of using the title attribute that was intended for that use.[4] In Internet Explorer 8 the bug was fixed, and alt attributes no longer render as tooltips.[5]

The alt attribute is commonly, but incorrectly, referred to as the "alt tag".[2][6][7]

See alsoEdit

ReferencesEdit

  1. Why doesn’t Mozilla display my alt tooltips?. Retrieved on 22 July 2009.
  2. 2.0 2.1 Anne van Kesteren (16 December 2004). Alt attribute (alt tag, alt tooltip). Retrieved on 22 July 2009.
  3. Bug 25537 - Alt text is not displayed as a tooltip over <img>, Mozilla bugzilla
  4. W3C HTML WG (24 December 1999). 7.4.3 The title attribute. HTML 4.01 Specification. W3C. Retrieved on 22 July 2009.
  5. What's New in Internet Explorer 8 – Accessibility and ARIA. MSDN. Microsoft. Retrieved on 22 July 2009.
  6. Roger Johansson (7 November 2005). It’s alt attribute, not alt tag. 456 Berea Street. Retrieved on 22 July 2009.
  7. Tommy Olsson (20 July 2004). Alt tags. The Autistic Cuckoo. Retrieved on 22 July 2009.

External linksEdit

Also on Fandom

Random Wiki