HTML and XHTML documents that use frames or iframes
This technique relates to:
- Success Criterion 2.4.1: Bypass Blocks (Sufficient, together with H70: Using frame elements to group blocks of repeated material as a way to meet an unwritten technique)
- Success Criterion 4.1.2: Name, Role, Value (Sufficient as a way to meet G108: Using markup features to expose the name and role, allow user-settable properties to be directly set, and provide notification of changes)
The objective of this technique is to demonstrate the use of the
attribute of the
iframe element to describe the contents
of each frame. This provides a label for the frame so users can determine which frame
enter and explore in detail. It does not label the individual page (frame) or inline
frame (iframe) in the frameset.
Note that the
title attribute labels frames, and is different from the
title element which labels documents. Both should be provided, since the
first facilitates navigation among frames and the second clarifies the user's current
title attribute is not interchangeable with the
title labels the frame for users; the
labels it for scripting and window targeting. The
name is not presented to
the user, only the
In HTML5 the
frame element is marked as obsolete. The
iframe element remains part of the HTML5 specification.
This example shows how to use the
title attribute with
frame to describe the frames containing the navigation bar and the
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>A simple frameset document</title> </head> <frameset cols="10%, 90%"> <frame src="nav.html" title="Main menu" /> <frame src="doc.html" title="Documents" /> <noframes> <body> <a href="lib.html" title="Library link">Select to go to the electronic library</a> </body> </noframes> </frameset> </html>
This example shows how to use the title attribute with
describe the contents of an inline frame. The example also includes an alternative
link to the page included by the iframe element for older browsers, which may not
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>A document using iframe</title> </head> ... <iframe src="banner-ad.html" id="testiframe" name="testiframe" title="Advertisement"> <a href="banner-ad.html">Advertisement</a> </iframe> ... </html>
Resources are for information purposes only, no endorsement implied.
- Check each frame and iframe element in the HTML or XHTML source code for the presence of a title attribute.
- Check that the title attribute contains text that identifies the frame.
- Checks #1 and #2 are true.