ToC ~ Up ~ Prev ~ Next ~ Index |
Introduction to HTML Last Update: 5 January 1998 |
With Netscape Navigator 2.0, Netscape introduced a whole new model for HTML documents. This is the FRAME document, which lets you specify the display as having of a number of independent viewing frames, each of which can contain its own HTML document.
A multi-frame document does not contain a BODY element -- instead it contains a FRAMESET element, which defines the sizes, locations and initial contents of the individual FRAMES.
Here is an example:
<FRAMESET ROWS="10%,80%,10%"> <FRAME NAME="window1" SRC="document.html"> <FRAMESET COLS="50%,50%"> <FRAME NAME="window2" SRC="doc.html"> <FRAME NAME="window3" SRC="doggy.html"> </FRAMESET> <FRAME NAME="window4" SRC="doc444.html"> <NOFRAMES> <BODY BACKGROUND ......> .... stuff to display if the browesr does not understand FRAMESET... </NOFRAMES> </FRAMESET>
This first divides the display into three slices, the top and bottom being thing (10% of the display height), the remainder going to the middle frame. The first slice is named window1, and is initially loaded with the document document1.html -- the FRAME element defines the initial content of the cell (frames may be empty, in which case you leave out the SRC). The second slice is divided, by columns, intow two frames -- named window2 and window 3. And so on.
Click here to view this example document. Use the browsers "Back" button to return to this page
Once the frames are named, then a hypertext anchor can be instructed to targetthe returned data to a particular frame. This is done using a new TARGET attribute for A elements. For example, if a document contained the anchor:
<A HREF="some_stuff.html TARGET="window3">link text</A>
FRAME-capable browsers will take the retrieved data and place it in the window named "window3", regardless of where the link was selected.
If a browser does not support frames it will ignore all the frame elements, and will display the content of NOFRAMES. Conversely, if a browser does understand FRAMEs, it will ignore the content of NOFRAMES entirely. Thus NOFRAMES is your way of building documents that are useful to all possible audiences.
Programming FRAMEs is a more complicated than regular documents. Recall that the browser's back button does not always work the way you would expect. In particular, with Netscape 2.0 this button implies back with respect to the entire displayed area, and not just back in a single frame. Also, many computers only have 640x480 pixel displays -- so don't get carried away, creating pages with multiple framed areas -- you lose lots of space with the frame borders, and often do not add anything useful to the displayed information.
There is an excellent interactive FRAMEs tutorial by Charlton Rose, which you will find at
This tutorial is best viewed using a FRAME-capable browserYou will also find additional details on FRAMEs at the Netscape onlinke documentation page, found at: http://www.mcom.com/assist/net_sites/frames.html, although this set of documents is somewhat out of date (it was written in earlly 1996).
ToC ~ Up ~ Prev ~ Next ~ Index |
Introduction to HTML © 1994-1998 by Ian Graham Last Update: 5 January 1998 |