Home >
Computers >
Web Design
How to Use HTML ALT image Tags
How to use html ALT image tags and their purpose. What do ALT tags do?
HTML ALT
image tags are short for Alternate
Text for Images and they are actually an "attribute" of
the HTML image <IMG> tag. That's why
it's better to refer to them as Attributes and
not tags.
It is an essential label for describing
the specific purpose of
an image. ALT attributes are necessary
for individuals who have manually set their
browsers to not display images, users with
text-only browsers like Lynx, and
for visually impaired users with text-to-speech
browsers.
Example 1 below illustrates what the ALT attribute
looks like in code view for a company logo.
Instead of just calling it alt="logo" we
have stated the business name. It's important
to
keep the text as descriptive as possible without
making it too wordy.
Example 1
<img
src="logo.gif" alt="Late Night
Cyber Cafe Logo" width="32" height="32">
Non-essential page elements
like spacers, bullets, or decorative
borders should include a blank ALT
attribute
in the IMG tag (empty quotes) as Example 2 illustrates.
Example 2
<img src ="images/border.gif" alt="">
ALT Attributes for the Visually Impaired
Alternate
Text is also a part of the Section
508 Accessibility Standards and
essential for people with disabilities
who often use adaptive technologies that
include text-to-speech browsers (speech
synthesizers).
What is Section 508?
"In
1998, Congress amended the Rehabilitation
Act to require Federal agencies to make their
electronic and information technology accessible
to people with disabilities. Inaccessible technology
interferes with an individual's ability to
obtain and use information quickly and
easily."
Section 508 specifically states:
(a)
A text equivalent for every non-text
element shall be provided (e.g., via "alt", "longdesc",
or in element content).
Learn
More about Section 508
ALT Attributes for Search Engines
ALT Attributes are
visible to web
crawlers or more commonly known as search engine spiders.
Search engines are unable to view graphics
in formats like GIF or JPG. Because of this most engines will
read the content
of the image's html ALT attribute to determine the
purpose of a graphic image. Creating relevant,
and keyword rich ALT attributes is an essential
part of building a website and can help optimize your website for the search engines.