Using Frames to Make an Index for Your WebSite

Frames allow you to divide a webpage into multiple regions.  A different html document can be displayed in each region.  By using the command "name" in the frameset document and the command "target" in the displayed documents, you can control the window in which a link loads.

This sheet will explain only how to use frames to create an index column for your site.  For a broader introduction to frames see:  www.jalfrezi.com/fframes or www.sharkysoft.com/tutorials/frames.  

1.  The frameset document.  Example:

<html>
    <head>
          <title>UCLA Economics Department TA Website</title>
    </head>

    <frameset cols="120,*" frameborder=0 border=0 framespacing=0>
         <frame src="choicelist.html">
         <frame src="TAHome.html" name = "mainarea">
    </frameset>
</html>

As you can see the "frameset" command replaces the "body" command in the document.   cols="120,*" indicates that the webpage will be divided into two columns -- the first will be 120 pixels wide and the second will take up the rest of the space.  (cols= can be replaced by rows= and the width can also be defined by the percent of the screen used by used by each frame,  i.e. cols="50%,50%".  The number of columns you can create is unlimited.)
frameborder=0 border=0 framespacing=0 means that no border will appear between the frames in either Netscape or Explorer.
<frame src="choicelist.html"> is a command to load choicelist.html into the first frame. <frame src="TAHome.html" name = "mainarea"> is similar, but includes a name for the second frame that will allow you to open links in this frame.

2.  By default links load into the whole browser window.  Links in the choicelist or TAHome documents that are to be loaded into the "mainarea" (thus preserving the index of choices) must include the command target = "mainarea".
Example:
<a href="TAresources.html" target="mainarea">UCLA Resources</a>
When creating a link in Netscape Composer, add a target by clicking on the "Extra HTML" button and entering target = "mainarea" in the text box that appears.

All the links on a page that has been opened in a specific frame will also open in that frame.  To enable links (for example to another site) to load into the main window, use the command target = "_top".  To direct a link to open in a blank window use the command target = "_blank".