This document is also available in this non-normative format: Diff from previous Working Draft
Copyright
©
2014
?
2015
W3C
®
?
(
MIT
,
ERCIM
,
Keio
,
Beihang
),
All
Rights
Reserved.
).
W3C
liability
,
trademark
and
document
use
rules
apply.
This document contains best practice guidance for authors of HTML [ HTML5 ] documents on providing text alternatives for images.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
It
This
document
was
developed
through
the
HTML
Accessibility
Taskforce
Task
Force
,
and
is
published
by
the
HTML
Working
Group
with
approval
by
the
Protocols
and
Formats
Working
Group
.
It is a draft document and its contents are subject to change without notice.
This
The
body
of
this
document
was
published
by
the
HTML
Working
Group
as
a
Working
Draft.
It
is
expected
to
be
published
as
a
W3C
Working
Group
Note.
incorporated
into
HTML
5.1
directly.
Following
feedback
on
the
last
Working
Draft
,
a
number
A
list
of
bugs
were
raised
and
resolved.
Other
existing
bugs
are
still
under
consideration,
these
include
is
available.
Comments
on
this
draft
text
should
be
filed
at
the
provision
of
examples
W3C
Bugzilla
using
the
HTML
WG
Product
and
the
LC1
alt
techniques
component,
preferably
with
the
longdesc
a11y
attribute
for
longer
text
alternatives:
bug
26868
keyword.
This
document
was
published
by
the
HTML
Working
Group
and
bug
18450
.
as
an
Editor's
Draft.
If
you
wish
to
make
comments
regarding
this
document,
please
send
them
to
public-html@w3.org
(
subscribe
,
archives
).
)
with
[Alt
Techniques]
at
the
start
of
your
email's
subject.
All
comments
are
welcome.
Bugs
can
also
be
filed
directly
into
the
W3C
Bug
tracker
for
this
specification
.
Publication
as
a
Working
an
Editor's
Draft
does
not
imply
endorsement
by
the
W3C
Membership.
This
is
a
draft
document
and
may
be
updated,
replaced
or
obsoleted
by
other
documents
at
any
time.
It
is
inappropriate
to
cite
this
document
as
other
than
work
in
progress.
This
document
was
produced
by
a
group
operating
under
the
5
February
2004
W3C
Patent
Policy
.
The
group
does
not
expect
this
document
to
become
a
W3C
Recommendation.
W3C
maintains
a
public
list
of
any
patent
disclosures
made
in
connection
with
the
deliverables
of
the
group;
that
page
also
includes
instructions
for
disclosing
a
patent.
An
individual
who
has
actual
knowledge
of
a
patent
which
the
individual
believes
contains
Essential
Claim(s)
must
disclose
the
information
in
accordance
with
section
6
of
the
W3C
Patent
Policy
.
This
document
is
governed
by
the
1
August
2014
14
October
2005
W3C
Process
Document
.
The
HTML
alt
attribute
can
be
placed
on
any
img
element.
Its
content
should
provide
a
short
textual
description
of
the
image.
Such
descriptions
help
users
who
for
providing
any
reason
are
unable
to
view
the
images.
They
are
also
used
by
software
processing
HTML
documents,
such
as
Web
search
engines
and
in-page
user
agent
searches.
Except
where
otherwise
specified
the
alt
attribute
MUST
be
specified
on
every
img
element
and
MUST
NOT
be
empty.
The
value
SHOULD
be
an
appropriate
functional
replacement
for
the
image.
The
alt
attribute
is
an
essential
part
of
making
accessible
documents
as
well
as
providing
for
text-based
search
engines
and
other
consumers
of
HTML.
Text
such
as
the
content
of
alt
attributes
intended
to
be
used
when
images
are
unavailable
is
known
as
alternative
text,
and
is
an
instance
of
a
more
general
class
of
Text
alternatives
,[
WCAG
]
are
[
WCAG20
],
a
primary
way
of
making
visual
information
accessible,
because
they
can
be
rendered
through
any
sensory
modality
(for
example,
visual,
auditory
or
tactile)
to
match
the
needs
of
the
user.
Providing
text
accessible.
Text
alternatives
allows
allow
the
information
to
be
rendered
in
a
variety
of
ways
by
a
variety
of
user
agents.
For
example,
a
person
who
cannot
see
a
picture
can
have
the
text
alternative
read
aloud
using
synthesized
speech.
Authors
use
text
alternatives
to
provide
the
same
information
(or
in
many
cases
functionality)
to
people
who
cannot
see
an
image.
The
function
of
an
image
depends
on
its
context:
a
company
logo,
for
example,
might
be
part
of
identity
branding
on
a
home
page
but
function
as
a
navigation
icon
on
other
pages.
Thus,
the
same
image
may
need
different
alt
text
in
different
contexts.
See
also
the
longdesc
attribute
on
images
is
[
HTML-LONGDESC
]
for
a
very
important
accessibility
attribute.
Authoring
useful
way
to
link
to
external
text
alternatives
and
image
descriptions.
The
following
sections
give
some
principles
for
writing
text
alternatives
with
the
alt
attribute
content
requires
and
suggest
when
to
use
the
author
longdesc
attribute
to
carefully
consider
provide
more
detail.
Additional
guidance,
techniques,
and
examples
are
available
in
Resources
on
Alternative
Text
for
Images
.
Because
alt
is
an
HTML
attribute
there
are
some
restrictions
on
what
it
can
contain
and
how
it
can
be
used:
The
language
of
the
context
attribute
value
cannot
be
marked
as
being
different
from
that
of
the
image
element
itself.
This
is
not
usually
a
problem
in
which
practice
unless
the
image
appears
and
element
was
supplied
by
automated
language-based
document
assembly;
use
the
function
lang
(and
for
the
XML
syntax
the
xml:lang
attribute)
to
mark
the
language
of
the
alternate
text
if
it
differs
from
that
of
the
surrounding
text.
Attributes
are
plain
text
and
cannot
contain
sub-elements.
In
particular
this
also
means
that
fragments
of
MathML
or
SVG
cannot
be
included
in
an
alt
attribute
value,
and
that
emphasis
cannot
be
used.
The
value
of
the
alt
attribute
will
generally
be
rendered
by
an
HTML
user
agent
as
replacement
text
in
place
of
a
broken
or
unavailable
image,
or
if
image
display
is
disabled,
or
in
a
text-mode
browser.
The
replacement
text
will
usually
be
rendered
in
the
space
reserved
for
the
image.
If
the
text
does
not
fit
in
the
available
space,
some
user
agents
will
truncate
the
text
and
others
might
not
display
the
text
at
all,
reducing
accessibility
and
usability
of
the
document
for
sighted
users
in
the
case
that
images
were
not
available.
In
at
least
some
user
agents
the
CSS
overflow
property
may
have
be
used
to
allow
the
alternate
text
to
extend
outside
the
width
and
height
allocated
for
the
img
element.
Why
are
we
mentioning
something
that
only
works
in
some
user
agents?
I
would
strike
this
sentence
-
we
should
not
be
recommending
techniquies
that
context.
don't
work
portably.
Text
readers
will
generally
read
out
the
value
of
the
alt
attribute
every
time
it
is
encountered,
and
may
or
may
not
provide
the
user
with
a
way
to
skip
to
the
end
of
the
alternate
text
and
to
carry
on
reading
out
the
document
just
after
the
image
element.
This
means
that
documents
should
not
contain
overly
burdensome
alternate
text
even
if
it
might
fit
in
the
available
space.
For
visual
differentiation,
CSS
styles
such
as
color
can
be
applied
to
the
img
element.
Text
that
is
for
use
as
an
alternative
to
an
image
but
that
contains
formatting
or
markup
(e.g.,
tables
or
equations)
needs
to
be
made
available
separately
as
described
in
the
next
section,
Principles
for
providing
text
alternatives
.
In
this
case
a
short
text
alternative
(e.g.,
Maxwell's
Equations
)
SHOULD
be
used
in
the
alt
attribute.
The
guidance
included
here
addresses
alt
attribute
may
be
subject
to
XML
?attribute
value
normalization?
if
the
most
common
ways
document
is
served
as
XML
or
processed
by
XML
tools.
In
particular
this
normalization
removes
leading
and
trailing
ASCII
whitespace.
Non-breaking
spaces
such
as
 
are
not
subject
to
normalization
and
can
be
used
when
concatenating
the
alt
text
value
to
surrounding
text
might
cause
unacceptable
word
joining.
Even
though
there
are
restrictions
on
its
value,
the
alt
attribute
is
still
needed
in
order
to
make
documents
properly
accessible.
This
section
describes
general
principles
for
authors
and
developers
to
use
images.
Additional
guidance
when
considering
the
use
of
the
alt
attribute,
the
longdesc
attribute,
and
techniques
also
the
newer
ARIA
described-by
and
described-at
attributes.
[
WAI-ARIA
]
We mention described-at here, but it is 1) not approved and 2) we don't point that out until much later in the document. We should probably remove this reference or at least point to the information about its status.
The
Web
Accessibility
Initiative
provides
An
fDecision
Tree
to
help
authors
decide
what
to
put
into
an
alt
attribute
value.
Where
an
image
has
a
function
(e.g.,
a
button
to
press)
or
serves
a
clear
purpose
such
as
identifying
the
maker
of
a
page
by
a
company
logo,
be
direct
and
simply
give
the
purpose
(e.g.,
Make
Payment
or
W3C
Logo
).
If
an
image
is
used
to
stand
for
a
special
character,
emoji,
gaiji,
itaiji,
emoticon,
or
text
in
an
unusual
font,
the
alt
text
should
simply
be
the
text
that
is
on
the
image,
or
a
textual
equivalent
such
as
:-)
for
a
smiling
face.
In many cases Web fonts can be used instead of images, and, provided that the fonts are correctly encoded and that the characters represented are in Unicode, user agents that do not use the fonts will still render the correct text.
Recommended
practice
is
to
mark
up
mathematical
equations
with
MathML.
If
this
is
not
possible,
sometimes
a
picture
of
an
equation
is
used.
Similarly
even
complex
tables
can
usually
be
marked
up
in
HTML
directly,
but
sometimes
a
picture
is
used
instead.
In
these
and
similar
cases
the
alt
attribute
should
be
given
a
value
such
as
Equation
7
or
Table
of
wandering
monsters
by
level
.
Since
people
seeing
the
image
would
not
want
to
read
the
same
content
in
two
different
forms,
the
information
in
the
equation
or
table
picture
should
then
be
presented
in
an
external
document,
pointed
to
with
a
URI
as
the
value
of
the
longdesc
attribute,
for
example
longdesc
=
"equation007.html"
.
It
is
often
possible
to
represent
charts,
diagrams,
and
other
explanatory
sorts
of
pictures
using
[
SVG
].
This
does
not
automatically
make
such
pictures
accessible,
but
different
mechanisms
then
become
available
for
embedding
text
alternatives
in
Resources
on
Alternative
Text
the
SVG
images.
If SVG is for some reason not used then the same considerations as for images of equations and tables generally apply. A description of a diagram, however, may need to include information about the presentation as well as the information. For example, a government report in an archival format might mention the colors used in a bar chart in order to facilitate subsequent discussions.
Where an image or diagram can be described adequately with a short piece of plain text that would easily fit in the space otherwise occupied by the image, that text should be used for the text alternative.
If
an
image
is
purely
decorative,
it
is
not
necessary
to
give
it
alt
text
;
use
an
empty
value
for
the
alt
attribute.
If
the
image
separates
words
of
text
an
alternative
text
of
an
encoded
single
space
(e.g.,
alt=""
)
might
be
appropriate.
When multiple images are placed together, for example to make up a frame or border or when a complex image is split into smaller images, only the first image should normally have explanatory text, in order to avoid tedious repetition from a screen reader.
When
an
a
element
that
is
a
hyperlink
,
or
a
button
element,
has
no
text
content
but
contains
one
or
more
images,
include
text
in
the
alt
attribute(s)
that
together
convey
the
purpose
of
the
link
or
button.
In
this
example,
a
portion
of
an
editor
interface
<ul> <li><button><img src="b.png" alt="Bold"></button></li> <li><button><img src="i.png" alt="Italics"></button></li> <li><button><img src="strike.png" alt="Strike through"></button></li> <li><button><img src="blist.png" alt="Bulleted list"></button></li> <li><button><img src="nlist.png" alt="Numbered list"></button></li> </ul>
The
image
link
is
displayed.
Each
button
has
an
icon
representing
broken,
and
I
don't
see
such
an
action
a
user
can
take
on
content
they
are
editing.
For
users
who
cannot
view
the
images,
the
action
names
are
included
within
the
alt
attributes
of
image
name
in
the
images:
current
HTML
source.
Where
is
this
image?
In this example, a link contains a logo. The link points to the W3C web site from an external site . The text alternative is a brief description of the link target.
<a href="http://w3.org"> <img src="images/w3c_home.png" width="72" height="48" alt="W3C web site"> </a>
This example is the same as the previous example, except that the link is on the W3C web site . The text alternative is a brief description of the link target.
<a href="http://w3.org"> <img src="images/w3c_home.png" width="72" height="48" alt="W3C home"> </a>
Depending on the context in which an image of a logo is used it could be appropriate to provide an indication, as part of the text alternative, that the image is a logo . Refer to section on Logos, insignia, flags, or emblems .
In this example, a link contains a print preview icon. The link points to a version of the page with a print stylesheet applied. The text alternative is a brief description of the link target.
<a href="preview.html"> <img src="images/preview.png" width="32" height="30" alt="Print preview."> </a>In this example, a button contains a search icon. The button submits a search form. The text alternative is a brief description of what the button does.<button> <img src="images/search.png" width="74" height="29" > </button>
In
this
example,
a
company
logo
for
the
PIP
Corporation
has
been
split
into
the
following
two
images,
the
first
containing
the
word
PIP
and
the
second
with
the
abbreviated
word
CO
.
The
images
are
the
sole
content
of
a
link
to
the
PIPCO
home
page.
In
this
case
a
brief
description
of
the
link
target
is
provided.
As
the
images
are
presented
to
the
user
as
a
single
entity
the
text
alternative
PIP
CO
home
is
in
the
alt
attribute
of
the
first
image.
<a href="pipco-home.html"> <img src="pip.gif" alt="PIP CO home"><img src="co.gif" alt=""> </a>
Users
Readers
can
benefit
when
content
is
presented
in
graphical
form,
for
example
as
a
flowchart,
a
diagram,
a
graph,
or
a
map
showing
directions.
Users
also
benefit
when
content
presented
in
a
graphical
form
is
also
provided
in
a
textual
format,
these
users
include
those
who
are
People
unable
to
view
see
the
image
(e.g.
because
they
have
for
any
reason
will
need
the
information
provided
in
another
form.
Diagrams
often
convey
a
very
slow
connection,
or
because
they
are
using
lot
of
information.
This
means
that
a
text-only
browser,
or
because
they
are
listening
textual
alternative
may
be
quite
lengthy.
The
content
of
the
alt
attribute
is
in
general
limited
to
the
page
being
read
out
amount
of
text
that
will
fit
in
the
space
normally
occupied
by
the
image.
In
addition,
it
may
be
tedious
for
someone
listening
to
an
audio
rendition
of
a
hands-free
automobile
voice
Web
browser,
or
because
page
to
have
to
skip
over
a
lengthy
description
each
time
they
reach
the
diagram.
An
appropriate
technique,
then,
is
to
have
a
visual
impairment
short
description
in
the
alt
attribute,
such
as
bar
chart
of
product
sales
by
region
,
and
use
an
assistive
technology
to
render
the
text
link
to
speech).
a
longer
image
description.
In
An
image
description
in
this
context
is
text,
whether
embedded
in
the
following
example
we
main
document
or
elsewhere,
that
would
enable
a
reader
to
have
an
image
a
good
idea
of
what
the
image
looks
like.
This
is
different
from
an
alternate
representation
in
that,
for
example,
it
might
mention
that
a
pie
chart,
with
text
chart
is
circular
or
that
the
items
in
a
bar
chart
are
horizontal
rows,
and
should
mention
any
significant
colors.
Such
a
description
can
enable
people
to
participate
in
conversations
about
the
image,
or
to
answer
examination
questions
that
might
rely
on
the
way
the
information
is
represented
and
not
just
the
underlying
data.
alt
attribute
An
external
image
description
is
just
another
document,
normally
in
HTML,
that
describes
an
image.
You
should
consider
using
an
external
image
description
if
one
of
more
of
the
pie
chart:
following
applies:
alt
attribute
with
an
associated
text
alternative
In
A
text
alternative
presents
the
case
same
essential
information
as
a
diagram
or
illustration
but
in
a
text
format
accessible
in
cases
where
an
the
image
repeats
is
not
seen
or
used.
It
is
normally
contained
in
the
previous
paragraph
same
document
as
the
image.
You
should
supply
a
text
alternative
in
graphical
form.
The
addition
to
the
alt
attribute
content
labels
in
these
circumstances:
alt
cannot
contain
elements.
alt
xml:lang
for
language.
The
following
example
is
taken
from
a
(fictional)
examination
question
on
simple
color
theory.
Someone
unable
to
see
the
image
would
need
to
know
that
the
two
circles
are
colored
red
and
blue
respectively,
and
that
the
white
area
is
where
the
circles
overlap.
Someone
able
to
see
the
image
would
not
available,
for
example
because
want
to
waste
time
in
an
exam
context
reading
such
a
description.
In
addition,
the
src
description
is
too
long
for
an
alt
attribute
value
value.
To
meet
the
needs
both
of
users
who
see
the
image
an
users
who
don't,
an
image
description
is
incorrect,
provided
separately.
In
some
contexts
this
could
be
included
in
the
text
alternative
provides
same
HTML
document
as
the
user
examination
question
but
image
descriptions
for
educational
purposes
are
often
provided
by
third
parties
and
may
be
more
easily
managed
as
a
separate
file.
In
addition
browsers
used
by
people
with
accessibility
needs
might
not
have
JavaScript
available
or
enabled.
In
this
example
the
widely-supported
longdesc
attribute
is
used
to
point
to
an
external
description;
a
brief
description
more
general
attribute
to
point
to
external
descriptions,
aria-describedat
,
has
been
proposed
but
is
not
yet
(2015)
widely
supported.
Is
there
really
a
reason
to
say
whether
longdesc
is
widely
supported
or
not?
Longdesc
is
part
of
the
image
content:
HTML5
so
we
can
safely
recommend
its
use.
We
don't
need
to
point
out
that
it
is
widely
supported.
It
has
been
in
HTML
for
~20
years
-
Shane
What
color
should
be
used
to
complete
the
white
part
of
the
diagram,
assuming
a
reflective
color
model?
<p><img src="overlapping-circles.html" alt="overlapping circles" longdesc="overlapping circles-d.html><br> What color should be used to complete the white part of the diagram, assuming a reflective color model? </p>
alt
attribute
with
an
associated
text
alternative
In
cases
where
You
should
consider
supplying
a
text
alternative
in
addition
to
the
alt
attribute
in
these
circumstances:
alt
alt
cannot
be
marked
with
xml:lang
for
language.
Although
the
alt
attribute
is
essential
to
enable
someone
to
understand
which
image
was
not
rendered,
it
should
not
be
relied
on
to
convey
detailed
content.
Here's
an
example
of
a
flowchart
image,
image
with
a
short
text
alternative
included
in
the
alt
attribute,
in
attribute.
In
this
case
the
text
alternative
is
a
description
of
the
link
target
as
the
image
is
the
sole
content
of
a
link.
The
link
points
to
a
description,
within
description
(within
the
same
document,
document)
of
the
process
represented
in
the
flowchart.
<a href="#desc"><img src="flowchart.gif" alt="Flowchart: Dealing with a broken lamp."></a> ... ... <div id="desc"> <h2>Dealing with a broken lamp</h2> <ol> <li>Check if it's plugged in, if not, plug it in.</li> <li>If it still doesn't work; check if the bulb is burned out. If it is, replace the bulb.</li> <li>If it still doesn't work; buy a new lamp.</li> </ol> </div>
In
this
example,
there
is
an
image
of
a
chart.
It
would
be
inappropriate
to
provide
the
information
depicted
in
the
chart
as
a
plain
text
alternative
in
an
alt
attribute
as
the
information
is
a
data
set.
Instead
a
structured
text
alternative
is
provided
below
the
image
in
the
form
of
a
data
table
using
the
data
that
is
represented
in
the
chart
image.
Indications of the highest and lowest rainfall for each season have been included in the table, so trends easily identified in the chart are also available in the data table.
United Kingdom | Japan | Australia | |
---|---|---|---|
Spring | 5.3 (highest) | 2.4 | 2 (lowest) |
Summer | 4.5 (highest) | 3.4 | 2 (lowest) |
Autumn | 3.5 (highest) | 1.8 | 1.5 (lowest) |
Winter | 1.5 (highest) | 1.2 | 1 (lowest) |
<figure role="group" aria-labelledby="caption"> <img src="rainchart.gif" alt="Bar chart: Average rainfall in millimeters by Country and Season."> <table> <caption id="caption">Rainfall in millimeters by Country and Season.</caption> <tr><td><th scope="col">UK <th scope="col">Japan<th scope="col">Australia</tr> <tr><th scope="row">Spring <td>5.5 (highest)<td>2.4 <td>2 (lowest)</tr> <tr><th scope="row">Summer <td>4.5 (highest)<td>3.4<td>2 (lowest)</tr> <tr><th scope="row">Autumn <td>3.5 (highest) <td>1.8 <td>1.5 (lowest)</tr> <tr><th scope="row">Winter <td>1.5 (highest) <td>1.2 <td>1 lowest</tr> </table> </figure>
The
table
image
and
data
table
are
grouped
using
a
figure
element
with
a
[
WAI-ARIA
]
role="group"
.
The
figure
is
labelled
by
the
table
caption
content
using
aria-labelledby
.
Once
figure
and
figcaption
are
accessibility
supported
in
browsers,
the
addition
of
ARIA
attributes
will
not
be
required.
For
any
of
the
examples
in
this
section
the
details
and
summary
elements
could
be
used
so
that
the
text
descriptions
for
the
images
are
only
displayed
on
demand:
Default (closed) view:
Expanded view (after control activated):
<figure> <img src="flowchart.gif" alt="Flowchart: Dealing with a broken lamp."> <details> <summary>Dealing with a broken lamp</summary> <ol> <li>Check if it's plugged in, if not, plug it in.</li> <li>If it still doesn't work; check if the bulb is burned out. If it is, replace the bulb.</li> <li>If it still doesn't work; buy a new lamp.</li> </ol> </details> </figure>
The
details
and
summary
elements
are
not
well
supported
by
browsers.
Until
they
are
well
supported,
you
will
need
to
use
scripting
to
provide
the
functionality.
There
are
a
number
of
scripted
polyfills
and
custom
controls
available
in
popular
JavaScript
UI
widget
libraries
that
provide
similar
functionality.
Sometimes,
Sometimes
an
image
only
contains
only
text,
and
the
purpose
of
the
image
is
to
display
text
using
visual
effects
and
/or
and/or
fonts.
It
is
strongly
recommended
that
text
styled
using
CSS
be
used,
but
if
this
is
not
possible,
provide
the
same
text
in
the
alt
attribute
as
is
in
the
image.
This example shows an image of the text "Get Happy!" written in a fancy multi colored freehand style. The image makes up the content of a heading. In this case the text alternative for the image is "Get Happy!".
<h1><imgsrc="gethappy.gif"src = "gethappy.gif"alt="Getalt = "Get Happy!" ></h1>
When
an
image
is
used
to
represent
a
character
that
cannot
otherwise
be
represented
in
Unicode,
for
example
Unicode
(e.g.,
gaiji,
itaiji,
or
new
characters
such
as
novel
currency
symbols,
symbols)
the
text
alternative
should
be
a
more
conventional
way
of
writing
the
same
thing,
e.g.
thing
(e.g.,
using
the
phonetic
hiragana
or
katakana
to
give
the
character's
pronunciation.
In
this
example
from
1997,
a
new-fangled
currency
symbol
that
looks
like
a
curly
E
with
two
bars
in
the
middle
instead
of
one
is
represented
using
an
image.
The
alternative
text
gives
the
character's
pronunciation.
pronunciation).
Only
5.99!
<p>Only
<img
src="euro.png"
alt="euro
">5.99!
An
image
should
not
be
used
if
Unicode
characters
would
serve
an
identical
purpose.
Only
when
the
text
cannot
be
directly
represented
using
Unicode,
e.g.
Unicode
(e.g.,
because
of
decorations
or
because
the
character
is
not
in
the
Unicode
character
set
(as
in
the
case
of
gaiji),
set)
would
an
image
be
appropriate.
If
an
author
necessary
Web
fonts
can
be
used
to
supply
specific
representations
for
Unicode
characters.
This
is
tempted
preferable
to
the
use
an
image
of
images
because
their
default
system
font
does
not
support
a
given
character,
then
Web
Fonts
are
a
better
solution
than
images.
text
reader
or
search
engine
can
process
the
Unicode
character
directly.
An
illuminated
manuscript
might
use
graphics
ornate
forms
for
some
of
its
letters.
The
text
alternative
in
such
a
situation
is
just
the
character
that
the
image
represents.
nce upon a time and a long long time ago...
1.5<p><imgImages that include text Sometimes, an image consists of a graphics such as a chart and associated text. In this case it is recommended that the text in the image is included in the text alternative. Consider an image containing a pie chart and associated text. It is recommended wherever possible to provide any associated text as text, not an image of text. If this is not possible include the text in the text alternative along with the pertinent information conveyed in the image.alt="Figure 1. Distribution of Articles by Journal Category. Pie chart: Language=68%, Education=14% and Science=18%." ></p> Here's another example of the same pie chart image, showing a short text alternative included in the alt attribute and a longer text alternative in text. The figure and figcaption elements are used to associate the longer text alternative with the image. The alt attribute is used to label the image. <figure> <img src="figure1.gif" > <figcaption><strong>Figure 1.</strong> Distribution of Articles by Journal Category. Pie chart: Language=68%, Education=14% and Science=18%.</figcaption> </figure>srcThe advantage of this method over the previous example is that the text alternative is available to all users at all times. It also allows structured mark up to be used in the text alternative, where as a text alternative provided using the alt attribute does not.= "initials/fancyO.png"1.6Images that enhance the themes or subject matter of the page content An image that isn't discussed directly by the surrounding text but still has some relevance can be included in a page using the img element. Such images are more than mere decoration, they may augment the themes or subject matter of the page content and so still form part of the content. In these cases, it is recommended that a text alternative be provided. Here is an example of an image closely related to the subject matter of the page content but not directly discussed. An image of a painting inspired by a poem, on a page reciting that poem. The following snippet shows an example. The image is a painting titled the "Lady of Shallot", it is inspired by the poem and its subject matter is derived from the poem. Therefore it is strongly recommended that a text alternative is provided. There is a short description of the content of the image in thealtattribute and a link below the image to a longer description located at the bottom of the document. At the end of the longer description there is also a link to further information about the painting.=<header> <h1>The Lady of Shalott</h1> <p>A poem by Alfred Lord Tennyson</p> </header> <img src="shalott.jpeg" > <p><a href="#des">Description of the painting</a>.</p> <!-- Full Recitation of Alfred, Lord Tennyson's Poem. --> ... ... ... <p id="des">The woman in the painting is wearing a flowing white dress. A large piece of intricately patterned fabric is draped over the side. In her right hand she holds the chain mooring the boat. Her expression is mournful. She stares at a crucifix lying in front of her. Beside it are three candles. Two have blown out. <a href=" http://www.tate.org.uk/servlet/ViewWork?cgroupid=-1&workid=15984&searchid=false&roomid=false&tabview=text&texttype=10">Further information about the painting</a>. </p>"O"This example illustrates the provision of a text alternative identifying an image as> nce upon aphoto of the main subject oftime and apage. > <h1>Robin Berjon</h1> <p>What more needs to be said?</p>long long time ago...
In
many
cases,
the
cases
an
image
is
actually
just
supplementary,
and
supplementary
&emdash;
its
presence
merely
reinforces
the
surrounding
text.
In
these
cases,
the
alt
attribute
must
be
present
but
its
value
must
MUST
be
the
empty
string.
In general, an image falls into this category if removing the image doesn't make the page any less useful, but including the image makes it a lot easier for users of visual browsers to understand the concept.
It
is
not
always
easy
to
write
a
useful
text
alternative
for
an
image,
another
image.
Another
option
is
to
provide
a
link
to
a
description
or
further
information
about
the
image
when
one
is
available.
In
this
example
of
the
same
image,
there
is
a
short
text
alternative
included
in
the
alt
attribute,
and
there
is
a
link
after
the
image.
The
link
points
to
a
page
containing
information
about
the
painting
.
The
Lady
of
Shalott
A
poem
by
Alfred
Lord
Tennyson.
Full recitation of Alfred, Lord Tennyson's poem.
<header> <h1>The Lady of Shalott</h1> <p>A poem by Alfred Lord Tennyson</p> </header> <figure> <img src="shalott.jpeg" alt="Painting of a woman in a white flowing dress, sitting in a small boat."> <p><a href="http://bit.ly/5HJvVZ">About this painting.</a></p> </figure> <!-- Full Recitation of Alfred, Lord Tennyson's Poem. -->
Purely
decorative
images
are
visual
enhancements,
decorations
decorations,
or
embellishments
that
provide
no
function
or
information
beyond
aesthetics
to
users
who
can
view
the
images.
Mark
up
purely
decorative
images
so
they
can
be
ignored
by
assistive
technology
by
using
an
empty
alt
attribute
(alt="").
While
it
is
not
unacceptable
to
include
decorative
images
inline,
it
is
recommended
if
they
are
purely
decorative
to
include
the
image
using
CSS.
(
alt=""
).
Here's
an
example
of
an
image
being
used
as
a
decorative
banner
for
a
person's
blog,
the
blog.
The
image
offers
no
information
and
so
an
empty
alt
attribute
is
used.
Clara's Blog
Welcome to my blog...
<header> <div><img src="border.gif" alt="" width="400" height="30"></div> <h1>Clara's Blog</h1> </header><p>Welcome<p> Welcome to myblog...</p>blog... </p>
When
images
are
used
inline
as
part
of
the
flow
of
text
in
a
sentence,
provide
a
word
or
phrase
as
a
text
alternative
which
makes
sense
in
the
context
of
the
sentence
it
is
apart
of.
containing
sentence:
I you.
I<img src="heart.png"< img src = "heart.png"alt="love"alt = "love" >you.you .
My breaks.
My<img src="heart.png"< img src = "heart.png"alt="heart"alt = "heart" >breaks.breaks .
Unicode
characters
could
be
used
as
an
alternative
to
inline
images
where
appropriate.
Modern
browsers
have
support
for
characters
like
"?"
"♥"
and
"?",
"☺",
and
support
the
use
of
custom
fonts
to
render
those
as
colored
image
fonts,
or
an
author
can
use
image
replacement
techniques.
1.10
A
group
of
images
that
form
a
single
larger
picture
with
no
links
When
a
picture
has
been
sliced
into
smaller
image
files
that
are
then
displayed
together
to
form
the
complete
picture
again,
include
a
text
alternative
for
one
of
the
images
using
the
alt
attribute
as
per
the
relevant
relevant
guidance
for
the
picture
as
a
whole,
and
then
include
an
empty
alt
attribute
on
the
other
images.
In
this
example,
a
picture
representing
a
company
logo
for
the
PIP
Corporation
has
been
split
into
two
pieces,
the
first
containing
the
letters
"PIP"
and
the
second
with
the
word
"CO".
The
text
alternative
PIP
CO
is
in
the
alt
attribute
of
the
first
image.
<img
src="pip.gif"
alt="PIP
CO"
><img
src="co.gif"
alt=""
>
In
the
following
example,
a
rating
is
shown
as
three
filled
stars
and
two
empty
stars.
While
the
text
alternative
could
have
been
"?????",
the
author
has
instead
decided
to
more
helpfully
give
the
rating
in
the
form
"3
out
of
5".
That
is
the
text
alternative
of
the
first
image,
and
the
rest
have
empty
alt
attributes.
fonts.
alt
attribute.
Consider the following image which is a map of Katoomba , it has 2 interactive regions corresponding to the areas of North and South Katoomba:
The
text
alternative
is
a
brief
description
of
the
image.
The
alt
attribute
on
each
of
the
area
elements
provides
text
describing
the
content
of
the
target
page
of
each
linked
region:
<p>View houses for sale in North Katoomba or South Katoomba:</p> <p><img src="imagemap.png" width="209" alt="Map of Katoomba" height="249" usemap="#Map"> <map name="Map"> <area shape="poly" coords="78,124,124,10,189,29,173,93,168,132,136,151,110,130" href="north.html" alt="Houses in North Katoomba"> <area shape="poly" coords="66,63,80,135,106,138,137,154,167,137,175,133,144,240,49,223,17,137,17,61" alt="Houses in South Katoomba" href="south.html"><map name="Map"> <area shape="poly" coords="78,124,124,10,189,29,173,93,168,132,136,151,110,130" href="north.html" alt="Houses in North Katoomba"> <area shape="poly" coords="66,63,80,135,106,138,137,154,167,137,175,133,144,240,49,223,17,137,17,61" alt="Houses in South Katoomba" href="south.html"></map>
Generally, slicing an image for links should be used instead of image maps as fallback support for image maps is poorly supported.
In some cases an image is included in a published document, but the author is unable to provide an appropriate text alternative. In such cases the minimum requirement is to provide a caption for the image using the figure and figcaption elements under the following conditions:
In other words, the only content of the figure is an img element and a figcaption element, and the figcaption element must include (caption) content.
Such
cases
are
to
SHOULD
be
kept
to
an
absolute
minimum.
If
there
is
even
the
slightest
possibility
of
the
author
having
the
ability
to
provide
real
alternative
text,
then
it
would
not
be
acceptable
to
omit
the
alt
attribute.
In this example, a person uploads a photo, as part of a bulk upload of many images, to a photo sharing site. The user has not provided a text alternative or a caption for the image. The site's authoring tool inserts a caption automatically using whatever useful information it has for the image. In this case it's the file name and date the photo was taken.
The caption text in the example below is not a suitable text alternative and is not conforming to the Web Accessibility Guidelines 2.0. [ WCAG20 ]
text alternative provided" src="http://www.w3.org/TR/html/images/clara.png" height="258" width="300">
clara.jpg, taken on 12/11/2010.
<figure> <img src="clara.jpg"> <figcaption>clara.jpg, taken on 12/11/2010.</figcaption> </figure>
Notice that even in this example, as much useful information as possible is still included in the figcaption element.
In
this
second
example,
a
person
uploads
a
photo
to
a
photo
sharing
site.
She
has
provided
a
caption
for
the
image
but
not
a
text
alternative.
This
may
be
because
the
site
does
not
provide
users
with
the
ability
to
add
a
text
alternative
in
the
alt
attribute.
text alternative provided" src="http://www.w3.org/TR/html/images/elo.png" height="250" width="205">
Eloisa with Princess Belle
<figure> <img src="elo.jpg"> <figcaption>Eloisa with Princess Belle</figcaption>Sometimes the entire point of the image is that a textual description is not available, and the user is to provide the description. For example, software that displays images and asks for alternative text precisely for the purpose of then writing a page with correct alternative text. Such a page could have a table of images, like this: <table> <tr><tr> <th> Image <th> Description <tr> <td> <figure> <img src="2421.png"> <figcaption>Image 640 by 100, filename 'banner.gif'</figcaption> </figure> <td> <input name="alt2421"> <tr> <td> <figure> <img src="2422.png"> <figcaption>Image 200 by 480, filename 'ad3.gif'</figcaption></figure><td> <input name="alt2422"> </table> NoteSince some users cannot use images at all (e.g. because they are blind) the alt attribute is only allowed to be omitted when no text alternative is available and none can be made available, as in the above examples. 1.16An image not intended for the user Generally authors should avoid using img elements for purposes other than showing images. If an img element is being used for purposes other than showing an image, e.g. as part of a service to count page views, use an empty alt attribute. An example of an img element used to collect web page statistics. The alt attribute is empty as the image has no meaning.<img src="http://server3.stats.com/count.pl?NeonMeatDream.com" width="0" height="0" alt="" >
CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart". CAPTCHA images are used for security purposes to confirm that content is being accessed by a person rather than a computer. This authentication is done through visual verification of an image. CAPTCHA typically presents an image with characters or words in it that the user is to re-type. The image is usually distorted and has some noise applied to it to make the characters difficult to read.
To improve the accessibility of CAPTCHA provide text alternatives that identify and describe the purpose of the image, and provide alternative forms of the CAPTCHA using output modes for different types of sensory perception. For instance provide an audio alternative along with the visual image. Place the audio option right next to the visual one. This helps but is still problematic for people without sound cards, the deaf-blind, and some people with limited hearing. Another method is to include a form that asks a question along with the visual image. This helps but can be problematic for people with cognitive impairments.
It
is
strongly
recommended
that
alternatives
to
CAPTCHA
be
used,
as
all
forms
of
CAPTCHA
introduce
unacceptable
barriers
to
entry
for
users
with
disabilities.
Further
information
is
available
in
Inaccessibility
of
CAPTCHA
.
For
further
information,
see
[
TURINGTEST
].
This
example
shows
a
CAPTCHA
test
which
uses
a
distorted
image
of
text.
The
text
alternative
in
the
alt
attribute
provides
instructions
for
a
user
in
the
case
where
she
cannot
access
the
image
content.
<img src="captcha.png" alt="If you cannot view this image an audio challenge is provided."> <!-- audio CAPTCHA option that allows the user to listen and type the word --> <!-- form that asks a question -->
alt
attribute
The
primary
method
for
providing
text
alternatives
for
images
is
by
including
text
in
the
img
element
alt
attribute.
In
graphical
browsers
the
content
of
the
alt
attribute
is
typically
displayed
along
with
an
indication
(bordered
area
and/or
an
image
icon)
of
the
presence
of
an
image
when
the
image
is
not
displayed,
because
the
user
has
disabled
image
display
or
the
image
source
information
is
incorrect.
Assistive
technologies
such
as
screen
readers
will
typically
announce
the
presence
of
an
image
followed
by
the
alt
attribute
content.
Text
based
browsers
may
display
the
alt
attribute
content
in
brackets
or
in
different
colored
text
or
as
the
content
of
a
link
to
the
image
or
as
text
without
any
indication
of
the
image
or
prefixed
with
an
indication
of
the
image.
<imgsrc="example.jpg"src = "example.jpg"alt="textalt = "text alternative." >
alt
attribute
content
does
not
impact
upon
the
default
visual
display
of
content.
alt
attribute
is
not
available
to
some
users
who
may
find
it
useful.
alt
attribute
content
is
too
long
it
may
cause
display
issues
in
some
browsers.
alt
attribute
content
is
too
long
it
may
cause
reading
issues
in
some
assistive
alt
attribute
are
read
by
assistive
technologies
every
time
the
image
is
encountered,
with
no
possibility
of
skipping
and
no
distinction
from
the
surrounding
text.
alt
attribute
content.
alt
attribute
content
a
replacement
for
an
image?
The answer to this question depends on the content of the image and the context the image is being used in:
alt
attribute
as
a
container
for
a
text
alternative,
the
alt
attribute
content
can
be
a
label
for
the
image.
This
label
alt
attribute
as
a
container
for
a
text
alternative,
the
alt
attribute
content
alt
attribute
content
alt
attribute
alt
attribute
alt
attribute
alt
attribute
content
alt
attribute
content
alt
attribute
content
alt
attribute
content
alt
attribute
alt=""
Circumstances
in
which
it
is
appropriate
to
use
an
empty
or
null
alt
attribute:
Circumstances
in
which
it
is
not
appropriate
to
use
an
empty
or
null
alt
attribute:
figure
element
and
has
an
associated
caption
provided
using
the
figcaption
element.
Using
an
empty
alt
attribute
hides
an
image
from
some
users.
If
an
image
has
a
caption
the
image
needs
to
be
discoverable
by
users,
otherwise
a
caption
is
present
that
refers
to
nothing
for
some
users.
alt
attribute
hides
an
image
from
some
users.
In
order
to
have
the
possibility
of
interrogating
the
image,
the
image
must
be
discoverable.
alt
attribute
hides
an
image
from
some
users,
which
is
incorrect.
The
image
is
not
meaningless,
it
contains
information
which
a
range
of
users
could
interpret
with
the
aid
of
the
short
text
alternative
and
longer
description.
It
also
provides
a
text
alternative
for
users
who
have
images
turned
off
in
their
browsers,
so
they
alt
attribute
is
present
there
may
be
no
indication
that
an
image
is
present.
Furthermore
if
a
description
of
an
image
is
provided
in
a
document,
a
programmatic
association
between
the
image
and
the
descriptive
text
is
required.
Using
an
empty
alt
attribute
on
the
image
effectively
precludes
the
assigning
of
a
programmatic
A
text
alternative
for
an
image
should
be
as
long
as
it
needs
to
be
to
adequately
convey
the
information
in
the
image,
image
in
the
context
in
which
the
image
is
being
used.
alt
text
be?
While
there
are
no
definitive
right
or
wrong
lengths
for
text
alternatives
provided
using
the
img
element's
alt
attribute,
the
general
consensus
is
that
if
the
text
alternative
is
longer
30-50
words
(2
to
3
sentences),
it
should
not
be
considered
a
short
text
alternative
and
should
not
be
presented
using
the
alt
attribute.
Refer
to
the
section
-
Graphical
Representations:
Charts,
diagrams,
graphs,
maps,
illustrations
for
example
methods
of
providing
longer
text
alternatives
for
images.
A
text
alternative
provided
using
the
alt
attribute
is
exposed
to
screen
reader
users
as
a
text
string,
generally
announced
as
a
chunk,
and
cannot
be
structured
into
paragraphs
or
have
other
markup
added
to
aid
comprehension.
It
also
cannot
usually
be
interrupted,
so
brevity
can
be
of
considerable
value.
figure
and
figcaption
elements
The
figure
and
figcaption
elements
provide
a
method
to
explicitly
associate
a
caption
with
a
variety
of
content
including
images.
Any
content
inside
the
figure
element
that
is
not
contained
within
the
figcaption
element
is
labelled
by
the
content
of
the
figcaption
element.
The
figcaption
content
may
be
an
adjunct
to
the
text
alternative
provided
using
the
alt
attribute:
The
figcaption
content
may
be
a
text
alternative
for
the
image,
obviating
the
need
for
a
text
alternative
provided
using
the
alt
attribute.
This
would
only
be
the
case
if
the
figcaption
content
provides
an
adequate
text
alternative
for
the
visual
content
in
the
image:
<img src="example.jpg" alt="Shadow like figures and a graffiti tag drawn on the walls of a partially demolished building, illuminated by the light from a street lamp." >
Shadow
like
figures
and
a
graffiti
tag
drawn
Drawings
on
the
walls
of
a
partially
demolished
building,
illuminated
by
the
light
from
a
street
lamp
(photo).
building
(photo)
<figure>
<img src="shadows.jpg">
<figcaption>Drawings on the walls of a partially demolished building (photo). </figcaption>
</figure>
figcaption
will
be
explicitly
associated
with
the
image.
figure
and
figcaption
elements
are
not
currently
accessibility
supported
by
Until
the
figure
and
figcaption
elements
are
widely
accessibility
supported
by
browsers
and/or
assistive
technology
it
is
recommended
that
role="group"
be
used
on
the
figure
element
and
in
the
case
where
the
figcaption
content
is
the
text
alternative,
provide
a
label
for
the
image
in
the
alt
attribute.
These
recommendations
are
illustrated
in
following
example:
Shadow
like
figures
and
a
graffiti
tag
drawn
on
the
walls
of
a
partially
demolished
building,
illuminated
by
the
light
from
a
street
lamp
(photo
1).
<figure role="group"> <img src="shadows.jpg" alt="photo 1"> <figcaption>Shadow like figures and a graffiti tag drawn on the walls of a partially demolished building, illuminated by the light from a street lamp (photo 1). </figcaption> </figure>
figure
elements
In
cases
where
there
is
a
group
of
related
images
each
having
an
associated
caption,
it
is
recommended
that
nested
figure
and
figcaption
elements
be
used.
The castle through the ages: 1423, 1756, and 1966 respectively.
Charcoal on wood. Anonymous, circa 1423
.
Oil-based paint on canvas. Eloisa Faulkner, 1756.
Film
photograph.
Séraphin-Médéric
S?raphin-M?d?ric
Mieusement
,
1936.
<figure> <figcaption>The castle through the ages: 1423, 1756, and 1966 respectively.</figcaption> <figure> <img src="castle-etching.jpg" alt="The castle has one tower, and a tall wall around it."> <figcaption>Charcoal on wood. Anonymous, circa 1423.</figcaption> </figure> <figure> <img src="castle-painting.jpg" alt="The castle now has two towers and two walls."> <figcaption>Oil-based paint on canvas. Eloisa Faulkner, 1756.</figcaption> </figure> <figure> <img src="castle-fluro.jpg" alt="The castle lies in ruins, the original tower all that remains in one piece."> <figcaption>Film photograph. <span lang="fr">S?raphin M?d?ric Mieusement</span>, 1936.</figcaption> </figure> </figure>
The
title
attribute
must
not
MUST
NOT
be
used
to
provide
a
text
alternative
for
an
image.
The
title
attribute
must
not
MUST
NOT
be
used
to
provide
a
caption
for
an
image;
use
the
figure
and
figcaption
elements
to
provide
a
caption,
as
described
above.
Gaiji is a term meaning "external characters". In general, this means characters that are not represented in existing Japanese encoding systems such as [ UNICODE ].
Operating systems and other platforms provide a set of interfaces using an accessibility API that expose information about objects and events to assistive technologies . Assistive technologies use these interfaces to get information about and interact with those widgets . Examples of this are the Java Accessibility API [ JAPI ], Microsoft Active Accessibility [ MSAA ], the Mac OS X Accessibility Protocol [ AXAPI ], the Gnome Accessibility Toolkit (ATK) [ ATK ], and IAccessible2 [ IA2 ].
The accessible name is the name of a user interface element. Each platform accessibility API provides the accessible name property. The value of the accessible name may be derived from a visible (e.g., the visible text on a button) or invisible (e.g., the text alternative that describes an icon) property of the user interface element.
Colloquial
Alt
text
is
a
colloquial
term
for
a
text
alternative
provided
using
the
alt
attribute
of
an
img
element.
Hardware
An
assistive
technology
is
a
hardware
and/or
software
that
acts
as
a
user
agent,
or
along
with
a
mainstream
user
agent,
to
provide
functionality
to
meet
the
requirements
of
users
with
disabilities
that
go
beyond
those
offered
by
mainstream
user
agents.
A
more
detailed
explanation
of
assistive
technology
is
provided
in
the
WCAG
2.0
glossary.
[
WCAG20
]
Information and sensory experience to be communicated to the user by means of a user agent such as a web browser, including code or markup that defines the content's structure, presentation, and interactions.
alt
Attribute
or
Null
alt
Attribute
An
alt
attribute
with
no
content:
<img src = "null.gif" alt = "" >
A non-text content is any content that is not a sequence of characters that can be programmatically determined or where the sequence is not expressing something in human language
Note: This includes ASCII Art (which is a pattern of characters), emoticons, leetspeak (which uses character substitution), and images representing text.
It
must
be
possible
for
people
using
assistive
technologies
to
find
the
text
alternative
for
an
image
when
they
encounter
the
image
that
they
cannot
use.
To
accomplish
this,
the
text
must
be
"programmatically
associated"
with
the
image.
image
and
is
referenced
as
programmatic
association
.
This
means
that
the
user
must
be
able
to
use
their
assistive
technology
to
find
the
alternative
text
(that
they
can
use)
when
they
land
on
the
image
(that
they
can't
use).
Text that is programmatically associated with non-text content or referred to from text that is programmatically associated with non-text content. Programmatically associated text is text whose location can be programmatically determined from the non-text content. [ UNDERSTANDING-WCAG20 ]
Incomplete and in no particular order - Heydon Pickering, David MacDonald, Laura Carlson, Josh O Connor, Gez Lemon, Anne van Kesteren, Ian Hickson, Mike Smith, Mike Paciello, Bim Egan, Gregory Rosmaita, Michael Cooper, Janina Sajka, Matt May, Bevi Chagnon, Jonathan Avila, Pat Rees, Charlie Pike, Andy Maseyk, Rich Clark.