Create a website RSS feed

Creating Links Between Frames

Creating Links Between Frames

Last update on: 09-11-2008
One 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:

As you have already seen, each <frame> element can carry the name attribute to give each frame a name. This name is used in the links to indicate which frame the new page should load into. Consider this very simple example:

<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>

Working with Frames's lessons:

Introduction To Frames
When To Use Frames
The Frameset Element
The Frame Element
The Noframes Element
Creating Links Between Frames

Banner HomeServices Contact |  ©2009 http://www.iteachweb.net/