home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeHTML & XHTML: The Definitive GuideSearch this book

2.11. Frames

Anyone who has had more than one application window open on their graphical desktop at a time can immediately appreciate the benefits of frames. Frames let you divide the browser window into multiple display areas, each containing a different document.

Figure 2-6 is an example of a frame display. It shows how the document window may be divided into many individual windows separated by rule lines and scroll bars. What is not immediately apparent in the example, though, is that each frame may display an independent document, and not necessarily HTML or XHTML ones, either. A frame may contain any valid content that the browser is capable of displaying, including multimedia. If the frame's contents include a hypertext link the user selects, the new document's contents, even another frame document, may replace that same frame, another frame's content, or the entire browser window.

Figure 2-6

Figure 2-6. Frames divide the window into many document displays

Frames are defined in a special document in which you replace the <body> tag with one or more <frameset> tags that tell the browser how to divide its main window into discrete frames. Special <frame> tags go inside the <frameset> tag and point to the documents that go inside the frames.

The individual documents referenced and displayed in the frame document window act independently, to a degree; the frame document controls the entire window. You can, however, direct one frame's document to load new content into another frame. Selecting an item from a table of contents, for example, might cause the browser to load and display the referenced document into an adjacent frame for viewing. That way, the table of contents is always available to the user as he or she browses the collection. For more information on frames, see Chapter 11, "Frames".

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.