Penn State Homepage

Teaching and Learning with Technology

Creating Accessible Web Sites

Images

This Page

  1. Synopsis
  2. Implementing the ALT Tag
  3. Use TITLE Tag for Tooltips
  4. ALT Text for Navigational Elements
  5. Filler and Decorative Images
  6. Summary ALT Tag Descriptions
  7. Extended Descriptions
  8. ASCII Art
  9. Links

Synopsis

  1. Whenever you use an image, be sure to include an ALT tag within the IMG tag to provide a clear text alternative. ALT text should be used for all images, graphical bullets, and graphical horizontal rules. If there is no ALT tag, then screen readers will hear [IMAGE] but no additional information. ALT text should let the user know what an image is and the purpose of that image.

    SECTION 508 - A text equivalent for every non-text element shall be provided (e.g. via "alt", "longdesc", or in element content.

  2. The text in the ALT text should be meaningful in the context of the Web page. Specifically:

    1. Images used as links should have alt text describing the destination of the link, not the image itself.
    2. Alt text with acronyms should be written with spaces in between letters. For instance <alt="I T S at P S U" > (read as "I T S at P S U") would be more accessible than <alt="ITS at PSU" > (read as "It's at Sue")
    3. Images used as spacers, toolbars or toolbars can be specified as <alt="" > so that screen readers skip over them (although some older screen readers will say "empty alt tag" and read the file name).
    4. Images embedded in Web pages which already include a text description can have a summary ALT tag.

     

  3. If you want to provide a tooltip for visual browsers, use the TITLE tag in addition to the ALT tag since it is supported in more browsers. For example:

  4. For images which are especially complex, such as a chart, equation or diagram, a link to an extended text caption should also be included.

  5. Images which are used as buttons or labels should use fonts which are readable to a large segment of the audience (probably 14 pixels/points or larger).

  6. STYLE TAG - In some cases you can replace custom tool lines and decorative graphics with styled HR or DIV tags in which you change background colors and specify background images. See CSS style sheet tutorials for more details.

Top of Page

Implementing Alt Text

The ALT tag adds a text description to a Web image. If viewers cannot see an image, then the description is displayed. This benefits users of screen readers, users of Palm Pilots viewing a Web site and users on a low-bandwidth connection where images are slow to download.

The ALT tag is included within the image tag. You can also include the TITLE and LONGSDESC attributes as well since this is also recognized by some devices.

NOTE: The ALT tag is limited to 50 characters. If more information is needed, then use one of the long description strategies.

Sample ALT text Code

<img src="imageXXX.gif" alt="Description" title="Description">

Demo Web site with Image links

Fake Child Education Site Label

Math Problems Label
Science Labs Label
Word Games Label
History Facts Label

What Screen Reader Says with Alt Tag

Fake Child Education Site Label

Math Problems Label
Science Labs Label
Word Games Label
History Facts Label

View the Code

<img src="K12Title.gif" alt="Fake Child Education Site Label"> </p>
<p> <img src="K12MathProblems.gif" alt="Math Problems" <br>
...

What Screen Reader Says without Alt Tag

 




Screen reader says "Image" five times.

 

Top of Page

Use TITLE for Tooltips

Some browsers, particular Internet Explorer for Windows, may display ALT text as a visible tooltip. Therefore, some Web sites use this feature to include supplemental information within visual browsers.

However, this technique should be avoided since other browsers do not show ALT text as tooltips. In addition, this interferes with the basic function of the ALT tag which is to provide a short text equivalent of an image. All navigational elements should be indicated by textual elements which can be accessed by a visual browser.

Use the TITLE Tag instead for tooltips since they are supported in all browsers. See example below.

TITLE Tooltip Example

HTML Code
<img src="bluemark.gif" alt="Penn State University" title="Penn State Logo from 1855" >

Example (Hold cursor over image to test tooltip)
Penn State University

 

Top of Page

Alt Text for Navigational Elements

For images used as navigational elements, the ALT Text can typically just state where the link is going. Stating a full description of the image is redundant in most cases.

 

Inaccessible Alt Tag for Graphic Link

This code is meant to implement the Penn State logo as a link to the homepage.

View the Code

<a href="http://www.psu.edu" > <img src="psulogo.gif" alt="Penn State Logo"> </a>

A screen reader would say "Penn State Logo" but would not indicate that this link goes to the Penn State homepage.

Accessible Alt Tag for Graphic Link

This code is a more accessible implementation of the Penn State logo as a link to the homepage.

View the Code

<a href="http://www.psu.edu"> <img src="psulogo.gif" alt="Penn State Home Page"> </a>

The screen reader would say "Penn State Homepage" which indicates where the link is going.

If more information about the image or its design is desired, then a D link or LONGDESC tag can be provided.

Top of Page

Alt Text for Filler or Decorative Images

Some images such as invisible pixels or custom tool lines are used solely for layout purposes and provide no content. The alt tag for these should be set to a blank space or nothing <alt= "" > . This causes the screen reader to ignore the image altogether.

For example we will use a sample image of a rainbow toolbar, followed by some accessible and inaccessible code examples

Accessible Toolbar Image Code

demo rainbow toolbar

<img src="examples/spectrumtooltip.gif" alt="" >

Screen Reader Says nothing and goes on to the next section

 

Less Accessible Toolbar Image Code

<img src="examples/spectrumtooltip.gif" alt="A Rainbow line used as toolbar" >

Screen Reader says "Rainbow line as a toolbar". If you have eighteen rainbow toolbars, the screen reader would repeat this eighteen times. This is irrelevant to a screen reader user and increases reading time.

 

Inaccessible Toolbar Image Code (no < alt > )

<img src="examples/spectrumtooltip.gif" >

With no ALT tag, Screen Reader Says "Image" which leaves users wondering if they are missing anything important.

NOTE: Alt text combined with transparent image can be used to provide special information just to users on screen readers such as a way to skip navigation.

Top of Page

Summary Alt Text

If an image is embedded within a Web page in which already includes an extended description of the image, then the ALT tag can just provide a summary of the image, not a full description.

Example Text with Image

Below is an image of a saturated fat molecule with 18 carbon molecules. Notice that the single bonds between elements make the carbon chain relatively straight.

Saturated Fat Molecule

Accessible Summary Alt Tag

<...alt="saturated fat molecule" >

 

Less Accessible Verbose Alt Tag

<...alt="image of straight saturated fat with 18 carbons" >

NOTE: This kind of description would be useful if the context is needed to understand the content, although a better strategy may be to include the text in the Web page itself or to link to a longer description as discussed in the next section.

Top of Page

Links to Extended Descriptions

In some cases, it may be necessary to add a link to an extended description of an image, especially for cases where images are used to convey significant content. There are several ways this can be accomplished - including a LONGDESC tag, a "D-link" or just a caption which links to the long description. See below for examples

Link to Caption Text

If the information is critical, then an overt caption link may be the best solution. This provides the clearest indication to the most users that a longer description is available.

saturated fat moluecule
View Extended Text Description

D-Links

Some experts advocate the use of a "D-link" to signal the presence of an extended text description. However, some users may not be aware of the convention. This is best used to provide supplemental information.

Saturated Fat MolueculeD

Longdesc Attribute

This is a hidden attribute which is recognized by some, but not all, screen readers. This may be best for providing extra detail which enhances content, but is not critical to it.

football player photo

View the Longdesc code

<img src="examples/runningfootbalplayer.jpg" alt="photo of football player" width="102" height="154" longdesc="dfootball.html" >

Longdesc Text (in dfootball.html)

This is a publicity photo of a Penn State football player running with the football in a crowded football stadium on a sunny day.

Top of Page

ASCII Art

ASCII art, or the use of punctuation and letter symbols to draw out an image will be inaccessible for screen readers since they will read each symbol aloud. Images supplemented with ALT text would be more accessible.

If an ASCII art image is truly needed in a Web page, then creating it in Photoshop or other photo editor may be a better alternative.

NOTE: If you include complex ASCII art in an e-mail signature, then it should be placed at the bottom after your contact information.

Inaccessible ASCII Art Image

ascii nittany lion

This is a GIF file, but if it were true ASCII art, a screen reader would say:

left parenthesis quote acute accent dash quote backslash quote right parenthesis...

Top of Page

Links on ALT Tags

Top of Page

Site Menu: Home Page/Main Menu | Section 508 Guidelines | Quick Checklist | Details by Tag
| Links | I.T.S. Seminar Page | Sitemap


©1999-2006 Pennsylvania State University.

This Web page is hosted by (by Teaching and Learning with Technology, a unit of Information Technology Services. Please contact the Webmaster if you have any questions.

Last Update: Monday, 08-Aug-2005 16:12:31 EDT