This is a W3C Working Draft for review by W3C members and other interested parties. It is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". This is work in progress and does not imply endorsement by, or the consensus of, either W3C or members of the WAI GL Working Group.
This document has been produced as part of the W3C WAI Activity, and is intended as a draft of a Proposed Recommendation for authoring accessible Web pages. The goal of the WAI-GL working group is discussed in our charter.
This document is a list of markup guidelines that HTML authors should follow in order to make their pages more accessible for people with disabilities and more useful to indexing robots. Following the list of guidelines is a checklist that authors and Web masters should use to verify page accessibility. Tools that generate documents in HTML (authoring tools, file conversion packages or other products) should produce documents that follow these guidelines. This document is part of a series of accessibility documents published by the Web Accessibility Initiative.
Please send detailed comments on this document to w3c-wai-gl@w3.org. Public comments about the WAI author guidelines can also be sent to this mailing list.
Note. Some people have encountered problems printing this page due to the use of style sheets. We have tried to correct the problem but ask that people help us explore solutions.
This document recommends guidelines that HTML authors should follow in order to improve the accessibility of their pages. Some of the guidelines take advantage of the features of HTML 4.0, but many of them apply to earlier versions of HTML as well.
Measures to improve accessibility fall roughly into the following categories:
The following sections offer specific guidelines that HTML authors should use to improve the accessibility of their pages.
Each guideline is accompanied by a rating that describes its importance:
Each guideline may be implemented by one or more "strategies" in HTML (and possibly a style sheet language). Each strategy may be classified according to the immediacy of its application:
Strategies with no classification work for versions of HTML prior to HTML 4.0, and old or new browsers.
DL, UL, OL, LI
) should only be used to create lists.
Avoid using list elements for presentation effects such as indentation.[New]
Use style sheets rather than HTML attributes to control item spacing. Note.
See item 7 in this section.
BLINK
and MARQUEE
elements. First of all, these elements are not part of HTML 4.0 (they are proprietary
extensions and should be avoided. See item 1). Second, blinking and moving
text is either read incorrectly or not at all by screen readers, can adversely
affect people with cognitive disabilities, and is often annoying to people in general (see
Jared Spool's book, "Web Site Usability"). Authors should use style sheets to
draw attention to text in other ways, such as different fonts, sizes, or colors. B and I
).TT, and
FONT
) and attributes ("align"
and
"background") that control visual presentation. Authors are encouraged to use
elements (such as STRONG
, EM
, H1
, H2
, ABBR
,
etc.) that add structure to documents. Documents that use style sheets for
presentation allow users to adjust the look of the document (e.g., larger print, color
contrast, etc.) through personal style sheets or browser settings. EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, and
ACRONYM
H1, H2,
etc. H1, H2
, etc.) to generate navigation tools, etc.).
BLOCKQUOTE
element to indent a paragraph that is
not a quotation; use style sheets. Do not use PRE
to create a tabular layout
of text; use tables. HR
) might convey a structural change to
some users, it may not to all users. Instead, specify structure with DIV
and SPAN
.
For example: <DIV class="navigation-bar">
<HR title="Navigation bar">
[ <A rel="Next" href="next.html">Next page</A> |
<A rel="Previous" href="previous.html">Previous page</A> |
<A rel="First" href="first.html">First page</A> ]
</DIV>
<HR title="new section">
<ABBR title="Idaho">ID</ABBR>
<ACRONYM title="World Wide Web">WWW</ACRONYM>
Tips and Tricks
Please also consult the section on links.
alt
" attribute is mandatory for the AREA
and IMG
elements. It should also be used for buttons used as submit buttons on forms (INPUT
and BUTTON
elements). For example: <IMG
src="magnifyingglass.gif" alt="Search">
. However, the
recommendations for alt-text vary depending on how the graphic is used (decoration,
button, bullet, illustration, etc.). Please see Appendix B -
Alt-text authoring guidelines for more information.OBJECT
is used, text can be provided in the body of the OBJECT
element. For example:<OBJECT
data="magnifyingglass.gif">Search</OBJECT>
Note. Longer descriptions of the appearance of an image may be
provided. See the next recommendation for solution strategies.
<IMG src="97sales.gif" alt="Sales for
1997">
<A href="sales.html" title="Description of 1997 sales
figure">D</A>
longdesc
" attribute of the IMG
element. For example:<IMG src="97sales.gif" alt="Sales for 1997"
longdesc="sales.html">
OBJECT
element:<OBJECT data="sales.gif">
Sales in 1997 were down subsequent to ...
</OBJECT>
alt
" or "title
"
attribute values of AREA
elements to present a list of links in place of
the image map graphic. Keyboard navigation to areas within the image map is also
possible since the browser knows the coordinates of the defined areas.When a
server-side image map must be used, authors should provide an alternative list of image
map choices. If an alternative list of links follows the image map, authors should
indicate with the "alt
" attribute of the IMG
element
the existence and location of the alternative list. A more straightforward solution,
although newer and less backwards compatible, is to include the alternative links within
the body of an OBJECT
element (see examples below). One final possibility is
to create an alternative page that is accessible.
For client-side image maps, there are several solution strategies:
MAP
element has been used with AREA
, set the "alt
"
attribute of the AREA
element. For example, with the IMG
element: <IMG src="welcome.gif" alt="Image map of areas in the library"
usemap="#map1">
<MAP name="map1">
<AREA shape="rect" coords="0,0,30,30" href="reference.html"
alt="Reference">
<AREA shape="rect" coords="34,34,100,100" href="media.html"
alt="Audio Visual lab">
</MAP>
OBJECT
element with
flexibility to include more information: <OBJECT data="welcome.gif" usemap="#map1">
There are several areas in the library including
<A href="reference.html">Reference</A>
and <A href="media.html"> the Audio VisualLab</A>.
More text can follow or precede.
<MAP name="map1">
<AREA shape="rect" coords="0,0,30,30"
href="ref.html" alt="Reference">
<AREA shape="rect" coords="34,34,100,100"
href="media.html" alt="Audio Visual Lab">
</MAP></OBJECT>
MAP
element can be used with A
elements to
specify active region geometries and provide contextual information. <OBJECT data="navbar1.gif" type="image/gif" usemap="#map1">
<MAP name="map1">
<P>Navigate the site:
<A href="guide.html"
shape="rect" coords="0,0,118,28">Access Guide</a> |
<A href="shortcut.html"
shape="rect" coords="118,0,184,28">Go</A> |
<A href="search.html"
shape="circle" coords="184,200,60">Search</A> |
<A href="top10.html"
shape="poly" coords="276,0,373,28,50,50">Top Ten</A>
</MAP>
</OBJECT>
Note in this example that the MAP
element is the content of the OBJECT
element so that the alternative links will only be displayed if the image map
(navbar1.gif) is not.
"title"
attribute of the A
element to provide
more information about images used as links. For example: <A href="home.html" title="Search the whole XYZ company site">
<IMG src="magnifyingglass.gif" alt="Search">
</A>
NOSCRIPT
element allows authors to supply alternative
presentations of content for scripts. For example: <SCRIPT type="text/tcl">
...some Tcl script to show a billboard of sports scores...
</SCRIPT>
<NOSCRIPT>
<P>Results from yesterday's games:
Bulls 91, Sonics 80 <A href="bullsonic.html">Bulls v. Sonics game recap</A>
...more scores...
</NOSCRIPT>
APPLET
element. <APPLET
code="Press.class" width="500" height="500"
alt="Java applet: how temperature affects
pressure.">
As temperature increases the molecules in the balloon...
</APPLET>
Note. The APPLET
element is deprecated in HTML 4.0.
OBJECT
element. <OBJECT
classid="java:Press.class" width="500" height="500"
title="Java applet: how temperature
affects pressure.">
As temperature increases the molecules in the balloon...
</OBJECT>
A more complex version takes advantage of the fact the OBJECT
elements may
be embedded to provide for alternative representations of information:
<!-- First, try the pressure applet -->
<OBJECT title="How temperature affects pressure"
classid="java:Press.class" width="500" height="500">
<!-- Else, try the MPEG video -->
<OBJECT data="pressure.mpeg" type="video/mpeg">
<!-- Else, try the GIF image -->
<OBJECT data="Pressure.gif">
<!-- Else render the description and an alternative -->
As temperature increases the molecules in the balloon...
</OBJECT></OBJECT></OBJECT>
APPLET
or OBJECT
elements. APPLET
or OBJECT
element (item 1 in this section) is the preferred method to provide alternative text
because it is backwards compatible. "alt"
attribute of the APPLET
element, as in: <APPLET code="Duke.class" width="50" height="50"
alt="Java applet: Duke waving.">
</APPLET>
Note. The APPLET
element is deprecated in HTML 4.0.
OBJECT
element, specify alternative text
within the "title
" attribute or within the body of the OBJECT
element (see item 1 in this section): <OBJECT classid="Duke.class" width="50" height="50"
title="Java applet: Duke waving.">
</OBJECT>
Note. More exploration is needed in this area. Please stay tuned.
title
" attribute to provide a brief
description of a very short sound.<A href="mittens.wav"
title="meow">Calico says "hello"</A>
headers
" and "scope
"
attributes. Please refer to the first two table examples in the appendix.
abbr
"
attribute) should be short but meaningful. This will be particularly useful for
future speaking technologies that will read row and column labels for each cell.
Abbreviations cut down on repetition and reading time. Please refer to the examples
in the appendix. summary
"
attribute of the TABLE
element) are especially useful for non-visual
users. Please refer to the examples in the appendix. axis
"
attribute) in the appendix. Tips and Tricks
Please also consult the section on image maps.
accesskey
" attribute of the LABEL, A, CAPTION, and
LEGEND
elements allows an author to associate a keyboard shortcut with the phrase.
For example, when associated with a link, it takes the user to the associated
document. <A accesskey="C" href="doc.html">XYZ
company home page</A>
NOFRAMES
element at the end of each FRAMESET
.
Please refer to the example in the Central
Reference Document. IMG
or OBJECT
elements.
<FRAMESET cols="10%,90%" title="Our library of electronic documents">
<FRAME src="nav.html" title="Navigation bar">
<FRAME src="doc.html" title="Documents">
<NOFRAMES><A href="lib.html" title="library link">
Select to go to the electronic library</A>
</NOFRAMES>
</FRAMESET>
longdesc
" attribute on the FRAME
and IFRAME
elements to designate a long description. BUTTON
or INPUT
elements with alternative text.
LABEL
element.[New] The "for
" attribute of the LABEL
element allows explicit association. For example:
<FORM action="http://somesite.com/adduser" method="post">
<FIELDSET>
<LEGEND>Personal information</LEGEND>
<LABEL for="firstname">First name:</LABEL>
<INPUT type="text" id="firstname" tabindex="1">
<LABEL for="lastname">Last name:</LABEL>
<INPUT type="text" id="lastname" tabindex="2">
...more personal information...
</FIELDSET>
<FIELDSET>
<LEGEND>Medical History</LEGEND>
...medical history information...
</FIELDSET>
</FORM>
<INPUT type="image"
name="submit" src="button.gif" alt="Submit">
tabindex
" attribute specifies the tabbing
navigation order among form controls. For example: <INPUT tabindex="1" type="text" name="field1">
<INPUT tabindex="2" type="text" name="field2">
<INPUT tabindex="3" type="submit" name="submit">
FIELDSET
element groups form controls while the LEGEND
element labels each group. Please see the example in guideline 10.2.OPTGROUP
element (with the SELECT
element). For example: <FORM action="http://somesite.com/prog/someprog"
method="post">
<P><SELECT name="ComOS">
<OPTGROUP label="Comm Servers">
<OPTGROUP label="PortMaster 3">
<OPTION label="3.7.1" value="pm3_3.7.1">PortMaster 3 with ComOS 3.7.1
<OPTION label="3.7" value="pm3_3.7">PortMaster 3 with ComOS 3.7
<OPTION label="3.5" value="pm3_3.5">PortMaster 3 with ComOS 3.5
</OPTGROUP>
<OPTGROUP label="PortMaster 2">
<OPTION label="3.7" value="pm2_3.7">PortMaster 2 with ComOS 3.7
<OPTION label="3.5" value="pm2_3.5">PortMaster 2 with ComOS 3.5
</OPTGROUP>
</OPTGROUP>
<OPTGROUP label="Routers">
<OPTGROUP label="IRX">
<OPTION label="3.7R" value="IRX_3.7R">IRX with ComOS 3.7R
<OPTION label="3.5R" value="IRX_3.5R">IRX with ComOS 3.5R
</OPTGROUP>
</OPTGROUP>
</SELECT>
</FORM>
accesskey
"
attribute. This example assigns "U" as the access key. Typing "U"
gives focus to the label, which gives focus to the control, so that the user can
input text. <FORM action="submit" method="post">
<LABEL for="user" accesskey="U">user name</label>
<INPUT type="text" name="user">
</FORM>
If, after best efforts, any page is still not accessible, provide a link to an alternative page that is accessible, has equivalent information, and is maintained with the same frequency as the inaccessible page. Alternative pages are not a recommended practice because maintenance costs increase the likelihood that the alternative pages will become outdated. If alternative pages are created they must be updated as frequently as the main pages and provide equivalent information.
LINK
element) so that the browser loads it automatically. If the
user has set their default media type to "aural," "braille," or
"tty" the user agent should load the alternative page automatically.
For example:
<HEAD>
<TITLE>Welcome to the Virtual Mall!</TITLE>
<LINK title="Text-only version"
rel="alternate" href="text_only.html"
media="aural, braille, tty">
</HEAD>
Following the general site design guidelines will further improve accessibility.
<HEAD><TITLE>Reference manual -- Chapter 1</TITLE>
<LINK rel="Start" title="The first page of the manual"
type="text/html"
href="http://someplace.com/manual/start.html">
<LINK rel="Next" title="Chapter 2"
type="text/html"
href="http://someplace.com/manual/ch2.html">
</HEAD>
Good Web Site Design Practices - Chapter 25 in the Central Reference Document
headers
" - The following example shows how to
associate header information with the "headers" attribute. The
"headers" attribute specifies a list of header cells (row and column labels)
associated with the current data cell. This requires each header cell to have an
"id
".
<TABLE border="border" summary="This table charts the number of cups of
coffee consumed by each senator, the type of coffee (decaf or regular),
and whether taken with sugar.">
<CAPTION>Cups of coffee consumed by each senator</CAPTION>
<TR>
<TH id="t1">Name</TH>
<TH id="t2">Cups</TH>
<TH id="t3" abbr="Type">Type of Coffee</TH>
<TH id="t4">Sugar?</TH>
<TR>
<TD headers="t1">T. Sexton</TD>
<TD headers="t2">10</TD>
<TD headers="t3">Espresso</TD>
<TD headers="t4">No</TD>
<TR>
<TD headers="t1">J. Dinnen</TD>
<TD headers="t2">5</TD>
<TD headers="t3">Decaf</TD>
<TD headers="t4">Yes</TD>
</TABLE>
A speech synthesizer might render by speaking the following:
Caption: Cups of coffee consumed by each senator Summary: This table charts the number of cups of coffee consumed by each senator, the type of coffee (decaf or regular), and whether taken with sugar. Name: T. Sexton, Cups: 10, Type: Espresso, Sugar: No Name: J. Dinnen, Cups: 5, Type: Decaf, Sugar: Yes
scope
" - The following example associates the
same header and data information as the previous example, but uses the "scope"
attribute rather than "headers." "Scope" must have one of the
following values: row, col, rowgroup or colgroup. Scope specifies the set of
data cells to be associated with the current header cell. This method is
particularly useful for simple tables. This example might be rendered by a speech
synthesizer as the previous example.
<TABLE border="border"
summary="This table charts the number of cups of coffee consumed by each senator, the
type of coffee (decaf or regular), and whether taken with sugar.">
<CAPTION>Cups of coffee consumed by each senator</CAPTION>
<TR>
<TH scope="col">Name</TH>
<TH scope="col">Cups</TH>
<TH scope="col" abbr="Type">Type of Coffee</TH>
<TH scope="col">Sugar?</TH>
<TR>
<TD>T. Sexton</TD>
<TD>10</TD>
<TD>Espresso</TD>
<TD>No</TD>
<TR>
<TD>J. Dinnen</TD>
<TD>5</TD>
<TD>Decaf</TD>
<TD>Yes</TD>
</TABLE>
"axis"
- The following example shows how to
create categories within a table.
<TABLE border="border">
<CAPTION> Travel Expense Report </CAPTION>
<TR>
<TH></TH>
<TH id="a2" axis="expenses">Meals</TH>
<TH id="a3" axis="expenses">Hotels</TH>
<TH id="a4"
axis="expenses">Transport</TH><TD>subtotals</ TD>
</TR>
<TR>
<TH id="a6" axis="location">San Jose</TH>
<TH></TH><TH></TH><TH></TH><TD> </TD>
</TR>
<TR>
<TD id="a7" axis="date">25-Aug-97</TD>
<TD headers="a6 a7 a2">37.74</TD>
<TD headers="a6 a7 a3">112.00</TD>
<TD headers="a6 a7 a4">45.00</TD><TD></TD>
</TR>
<TR>
<TD id="a8" axis="date">26-Aug-97</TD>
<TD headers="a6 a8 a2">27.28</TD>
<TD headers="a6 a8 a3">112.00</TD>
<TD headers="a6 a8 a4">45.00</TD><TD></TD>
</TR>
<TR>
<TD>subtotals</TD><TD>65.02</TD><TD>224.00&
</TD><TD>90.00</TD><TD>379.02</TD>
</TR>
<TR>
<TH id="a10" axis="location">Seattle</TH>
<TH></TH><TH></TH><TH></TH><TD> </TD>
</TR>
<TR>
<TD id="a11" axis="date">27-Aug-97</TD>
<TD headers="a10 a11 a2">96.25</TD>
<TD headers="a10 a11 a3">109.00</TD>
<TD headers="a10 a11 a4">36.00</TD><TD></TD>
</TR>
<TR>
<TD id="a12" axis="date">28-Aug-97</TD>
<TD headers="a10 a12 a2">35.00</TD>
<TD headers="a10 a12 a3">109.00</TD>
<TD headers="a10 a12 a4">36.00</TD><TD></TD>
</TR>
<TR>
<TD>subtotals</TD><TD>131.25</TD><TD>218.00
</TD><TD>72.00</TD><TD>421.25</TD>
</TR>
<TR>
<TH>Totals</TH><TD>196.27</TD><TD>442.00
</TD><TD>162.00</TD><TD>800.27</TD>
</TR>
</TABLE>
In general, authors should specify alternative text that describes the function of the graphic or image and not its visual appearance. Authors should ask themselves this question: if you were reading the document aloud over the telephone, what would you say upon encountering this image or graphic to make the page comprehensible to the listener?
There are three attributes of IMG that can be used to provide textual information about an image:
alt
" - should be used to give the functional and contextualized
label or description (rather than a visual description). Think of it as a
textual replacement for users and search engines. It should not
bring to the attention of the user that a picture exists and should be grammatically
correct. End alt-text with punctuation (comma, colon, or period) to indicate a pause
in reading, when appropriate. title
" - This is a new attribute to HTML 4.0 to provide
additional information about almost every element (only HEAD, BODY, and 8 other elements
do NOT support title as an attribute). There is some argument as to its appropriate
use as well as how it can be used in combination with alt-text to maintain backwards
compatibility. longdesc
" - used to provide a link to a page that has a complete
visual description of the image (required for charts, illustrations and other vital
information). Be sure to convey the spirit or the message of the image in long
descriptions.Note. Providing alternative text for images embedded with the OBJECT element is a different beast and will be covered in the future.
Provide a brief textual equivalent of the image. Providing alt-text is required, while
providing a longer description is recommended.
Example: <IMG src="sailboats.gif" alt="Sailboats in calm
water" longdesc="sailboatsdesc.html">
Then, within sailboatsdesc.html:
A picture of ten sailboats docked in calm water at the edge of busy street in a small town.
Since some users may not want to see even a short description of the graphic, keep them as short as possible. In the future, we will make recommendations for the use of style sheets, class values, and XML that will allow users to select types of images they wish to download and view.
Example
1:
<STYLE ...><!-- UL { list-style: none }-->
<UL>
<LI><IMG src="star.gif" alt="Item:">Audrey</LI>
<LI><IMG src="star.gif" alt="Item:">Laurie</LI>
<LI> ... </LI>
</UL>
Example 2: (Avoid)
<STYLE ...><!-- UL { list-style: url(star.gif) }-->
<UL>
<LI> Audrey</LI>
<LI> Laurie</LI>
<LI> ... </LI>
</UL>
Example:
<STYLE ...><!-- UL { list-style: none }-->
<UL>
<LI><IMG src="red.gif" alt="New:">Roth IRA</LI>
<LI><IMG src="yellow.gif" alt="Old:">401 K</LI>
<LI> ... </LI>
</UL>
Example:
<STYLE ...><!-- OL { list-style: none }-->
Song titles on our fourth album.
<OL>
<LI><IMG src="bullet1.gif" alt="One:">Room</LI>
<LI><IMG src="bullet2.gif" alt="Two:">Nice Guy</LI>
<LI> ... </LI>
</OL>
Provide the equivalent textual link phrase in the alt-text (i.e., if the link
were text instead of graphical what would it say).
Example: <A href="routes.html"><IMG src="topo.html"
alt="Current routes at Boulders Climbing Gym"></a>
For graphics used as section separators (e.g., horizontal rules) provide information
about what the graphic represents. In other words, provide an equivalent textual cue
as to what the visual reader perceives.
Example:
<IMG src="redline.gif" "End of Chapter 7 - Visual Displays">
<H1>Chapter 8 - Auditory and Tactile Displays</H1>
If the image is simply a picture of stylized or colorful text, then the alt-text must be the same as the text in the image. <P>This is an <IMG src="BigRedExample.gif" alt="Example"> of what we mean.</P>
Invisible or transparent images are often used to force the layout of a page. Provide "null" (alt="") or "white space" (alt=" ") alt-text, whichever the context requires.
Example 1: An image is used to create a carefully defined space between words or
graphics. "White space" alt-text is used to prevent the words from running
together when the image is not loaded.
my poem requires a big space<IMG src="10pttab.gif alt=" ">here
Example 2: An image is used to force a graphic to appear in a certain position
<IMG src="spacer.gif" alt=""><IMG
src="colorfulwheel" alt="The wheel of fortune">
OBJECT
is a backwards compatible
solution but not consistent across newer browsers.Each guideline may be accompanied by a rating that describes its importance:
If after best efforts, a page is still not accessible, provide a link to an alternative page that is accessible, has equivalent information, and is maintained with the same frequency as the inaccessible page.
The original draft of this W3C working document is based on The Unified Web Site Accessibility Guidelines compiled by the Trace R & D Center, University of Wisconsin under funding from the National Institute on Disability and Rehabilitation Research (NIDRR), U.S. Dept. of Education.
For a full list of Contributors to the Unified Guidelines is available at http://trace.wisc.edu/docs/html_guidelines/version7.htm .
We would also like to thank the people listed in the References section below whose works were used in the compilation of the unified guidelines on which this document is based.