Frames are often used to organize a page into logical units
of information. The relationship between the content in the various frames
(e.g., one frame has a table of contents, another the contents themselves) is
readily apparent to the sighted user; however, those relationships must be
conveyed by some other means for non-visual users.
There are a number of reasons why frames present
challenges to Web accessibility:
- Without scripting, they tend to break the
"previous page" functionality offered by browsers.
- It is impossible to refer to the "current
state" of a frameset with a URI (Uniform Resource Identifier, the
preferred term used by the World Wide Web Consortium for a "Web
address"); once a frameset changes contents, the original URI no longer
applies.
- Opening a frame in a new browser window can disorient
or simply annoy users. (However, opening another site's page within your
framed page can imply you are the document creator; increasingly this is a
touchy (legal) issue.)
Put
a title on each frame
<html>
<title>A simple frameset document</title>
</head>
<frameset cols="10%, 90%"
title="Our library of electronic documents">
<frame src="nav.html" title="Navigation bar">
<frame src="doc.html" title="Documents">
</frameset>
Include
a noframes element
For every occurrence of frameset, include immediately
after it a <noframes> element that directs a user to the appropriate Web
page. You may also want to describe the layout and purpose of frames and how
multiple frames relate to each other. In the example below, this is called
frameset-desc.html.
<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="noframes.html" title="Library link"> Select
to go to the electronic library
<p><a href="frameset-desc.html">Descriptions of
frames.</a></p>
</noframes>
</frameset>
The frameset-desc.html might say something like:
nav.html - this frame provides common
navigation links for the site
doc.html - this frame lists documents available electronically