Creating Links Between Frames
Last update on: 09-11-2008One of the most popular uses of frames is to place navigation bars in one frame and then load the pages with the content into a separate frame. This is particularly helpful in three situations:
- When your navigation bar is rather large in size (such as thumbnails of photographs in a gallery). By using frames, the user does not need to reload the navigation bar each time she views a new page.
- When your main document is very long and the navigation bar provides shortcuts to parts of the main document.
- When you do not want to reload the whole page.
<frameset cols="200, *"> <frame src="frames/linksNav.html" /> <frame src="frames/linksMain.html" name="main_page" /> </frameset>
There are two columns in this example. The first is 200 pixels wide and will contain the navigation bar. The second column or frame will contain the main part of the page. The links on the left side navigation bar will load pages into the right side main page.
The links in the linksNav.html file look like this:
<a href="http://www.wrox.com" target="main_page">Wrox Press</a><br />
<a href="http://www.google.com" target="main_page">Google</a><br />
<a href="http://www.microsoft.com" target="main_page">Microsoft</a><br />
<a href="http://news.bbc.co.uk/" target="main_page">BBC News</a>
<a href="http://www.google.com" target="main_page">Google</a><br />
<a href="http://www.microsoft.com" target="main_page">Microsoft</a><br />
<a href="http://news.bbc.co.uk/" target="main_page">BBC News</a>
Working with Frames's lessons:
Introduction To FramesWhen To Use Frames
The Frameset Element
The Frame Element
The Noframes Element
Creating Links Between Frames

