| Frames - targeting |
|
basics < targeting > nesting esthetics noframes bad things quick recap tags epilogue |
Inside frames, links behave much as they would in any browser window. Click on a link and the linked page will appear in the same frame. A very powerfull feature of frames however, is that you can click on a link, and let another window show the new page. The page with the link stays where just it is. A good use of this is creating a navigation bar with the links, and a main window to display the linked pages.
<FRAMESET COLS="150,*"> The COLS attribute is specified "150,*". This shows a 150 pixel wide frame to the left, and the remainder of the browser window for the other frame. It's best to always use an asterisk for the last frame, since there will be a blank area in your browser otherwise.
Names and targets <A HREF="mainpage.html" TARGET="main">main page</A>
This is a typical link to be used in frames. It is a normal hypertext reference, apart from the TARGET attribute. The TARGET attribute specifies the location where the linked page will be displayed. Be carefull about the spelling of the names and targets. If a target does not exist, your browser will open a new window. If no target is specified, the new page will be displayed in the wrong frame.
Reserved targets
Often you will only use one target for all links from your menu. In that case you can add a BASE tag to the HEAD section of your document. This target will then be used for all links in the web page. This will save you some typing, and may prevent possible typos. <BASE TARGET="main"> |