ToC ~ Up ~ Prev ~ Next ~ Index Introduction to HTML
Last Update: 5 January 1998

7.7 Netscape FRAME Element

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

7.7.1 Targeting Returned Documents to Specific FRAMES

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.

7.7.2 NOFRAMES for Browsers that Do not Support FRAMEs

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.

7.7.3 Things to Note about FRAMES

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.

7.7.4 Additional References on FRAMEs

There is an excellent interactive FRAMEs tutorial by Charlton Rose, which you will find at

This tutorial is best viewed using a FRAME-capable browser

You 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