Naming and targeting framesBy default, when you click on a link in a frame, the results of that link will load in the same frame as the one you clicked in. Often, however, when you click on a link, you want to load the contents of that link in a different frame than the one you clicked in. To do this, you'll need to use the new TARGET attribute of the A tag, and a new ATTRIBUTE of the FRAME tag: NAME. Give each frame in your frameset a frame name. This is done by adding the NAME attribute to the FRAME tag. You can name your frames anything you like, though it's best to keep it one simple word.
Once you've assigned each frame a name, then you just need to add the TARGET attribute to each link's A tag. The TARGET attribute's value will be the name of the frame that you want the link to load into. So, if you have a menu frame on the left side of your page that contains a list of links, and you want those links to load in the right frame (named "mainframe"), then each link in the left frame will need to have the attribute TARGET added to it's A tag, like this:
(Remember, these A tags aren't in the FRAMESET. They are on the separate HTML page that you're loading into one of the frames.) If all tags in the page point to the same target, you can place the tag <BASE TARGET="targetname"> in the HEAD section of the page. Then all links clicked on that page will automatically target the same place unless defined otherwise. There are some special TARGET values that you may need occasionally to get the target you want:
|