Read HTML The Definitive Guide Online
Authors: Chuck Musciano Bill Kennedy
Frames are enabled with a special frame document. Its contents do not get displayed. Rather, the frame document contains extension HTML tags that tell the browser how to divide its main display window into discrete frames, and what documents 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. That's done by attaching a name to a frame and targeting the named frame with a special attribute for the hyperlink tag.
11.4 Beyond Ordinary Tables
12.2 Frame Tags
Chapter 12
Frames
You need to know only three HTML tags to create a frame document:
Aframesetis simply the collection of frames that make up a browser's window. Column-and row-definition attributes for the
initially goes into the frames within those framesets, and is where you may give the frame a name to use for document hypertext links.
Here is the HTML source that was used to generate Figure 12.1:
Sorry, this document can be viewed only with a frames-capable browser.
Take this link to the first HTML document in the set.
Notice a few things in the simple frame example and its rendered image (Figure 12.1). First, the order in which the browser fills the frames in a frameset goes across each row. Second, frame 4 sports a scrollbar because we told it to, even though the contents may otherwise fit without scrolling.
(Scrollbars automatically appear if the contents overflow the frame's dimensions, unless explicitly
disabled with the scrolling attribute in the tag.)[, 12.4]
Another item of interest is the name attribute in one of the frame tags. Once named, you can reference a particular frame as the location in which to display a hypertext-linked document. To do that, you add a special target attribute to the anchor () tag of the source hypertext link. For instance, to link a document called new.html for display in frame 3, which we've named "fill_me", the anchor looks like this:
If the user chooses the link, say in frame 1, thenew.htmldocument will replace the originalframe3.htmlcontents in frame 3. [The target Attribute for the Tag, 12.7.1]
Finally, although Netscape and Internet Explorer both support frames, it is possible that some other browser users will try and view your frame documents. That's why each of your key frame documents should provide a back door to your HTML document collection with the tag.
Frame-capable browsers display your frames; nonframe-capable browsers display the alternative content.
12.2.1 What's in a Frame?
Anyone who has opened more than one window on their desktop display to compare contents or operate interrelated applications knows instinctively the power of frames.
One simple use for frames is to put content that is common in a collection, such as copyright notices, introductory material, and navigational aids, into one frame, with all other document content in an adjacent frame. As the user visits new pages, each loads into the scrolling frame, while the fixed-frame content persists.
A richer frame document-enabled environment provides navigational tools for your document collections. For instance, assign one frame to hold a table of contents and various searching tools for the collection. Have another frame hold the user-selected document contents. As users visit your pages in the content frame, they never lose sight of the navigational aids in the other frame.