Frames: HTML
Create Hyperlinks Between Frames
| The Simple Frameset | One of the advantages of frames is the ability to click on a hyperlink in one frame and change the document in another frame. | |||||
| When you activate a hyperlink in a frame document, you need to specify not only what document to load but also where (i.e., in which frame) to put it. | ||||||
| Targets | The frame where the new document is supposed to appear is called the target. | |||||
There are two types of targets
|
NOTE: the names assigned to the frames in the example are banner, toc, and main. | |||||
| Implicit target names always begin with
an underscore (_).
The two most common implicit names are:
The _top target name is most often used when you are linking to an external web site whose window may not fit in your frame. |
||||||
| Take another look at our frameset example: | ||||||
|
||||||
| Note that I have identified each frame by the name I gave it when I created the frameset in HTML: Create a Simple Frameset | ||||||
| I can also identify the frames by the names of the web page files I have inserted in each frame: | ||||||
|
||||||
| To create a hyperlink from one frame in a frameset to another frame in the same frameset, use the TARGET attribute with the anchor command. | ||||||
| For example, if I wanted to create a hyperlink in the toc frame that would change the document in the main frame from default.htm to pagetwo.htm I would use the following HTML code: | ||||||
| <A HREF="pagetwo" TARGET="main">Page Two</A> | ||||||
|
||||||
| When the visitor clicks on the hyperlink on Page Two in the left hand column, the contents of the right hand column change to the file pagetwo.htm. | NOTE: The Page Two hyperlink above is for illustration purposes only. It does not work. | |||||
Frames: HTML
Overview
Create a Simple Frameset
Create Hyperlinks Between Frames
Web Design Center
Last Revised:
October 19, 2006
© Agatha Taormina