If you code your frame definition pages as shown up to this point in the chapter, a link that appears in any of the pages opens its corresponding file in the same frame that holds the link. In other words, if I click a link that's shown in the upper-left frame, the page opened by that link also appears in the upper-left frame, replacing the file that was there. If you want a link in one frame to open a new page in another frame, you must do two things:
Naming the FramesUsing the page created in the preceding example as a starting point, name the frames. Add the NAME= attribute to the <FRAME SRC> tag after the filename (and a blank space), as shown in the following code: <FRAMESET ROWS="75%,*") <FRAMESET COLS"30%,*") <FRAME SRC="MULTI.HTM" NAME="Icons"> <FRAME SRC="DESCRIP.HTM" NAME="Text"> </FRAMESET> <FRAME SRC="DEFINI.HTM" NAME="Definitions"> </FRAMESET> It doesn't matter what you call the frames, as long as you give each one a unique name. The frame names are not displayed on the page, just in the source code.
Making Links Point to Frame NamesAfter naming the frames, you must edit the links within the content files to add the target : the name of the frame in which the linked files should open. To code your targets in HTML, you must add the TARGET= attribute and the frame name (in quotes) to the link, following the filename, as in the following example: <A HREF="avidef.htm" TARGET="Definitions"></a> When the link shown is executed, the file AVIDEF.HTM opens in the frame named Definitions (the bottom frame), replacing DEFINI.HTM . Suppose that you want every link in the MULTI.HTM file to open its file in the Text frame. When all links are to open in the same frame, you can save time by using the <BASE TARGET> tag in the content file's header. All links in a file containing a <BASE TARGET> tag open their files in the frame named by <BASE TARGET> ; you do not need to add any TARGET attributes to the link tags, as in the following example: <HTML> <HEAD> <TITLE> <BASE TARGET="Text"> </HEAD> <BODY> page definition goes here </BODY> </HTML> All links in the sample content file open their files in the Text frame. |