HTML Advanced Topics: Frames cont.

11. Targeting Frames

Here is the nested frame page that we've built:

Title Bar.html
Navigational bar.html Page Content.html

Do remember how we assigned each frame a name in the frame tag?

<frame name="Navigation" src="Navigational Bar.html"
NORESIZE scrolling="No" marginwidth="0" marginheight="0">

Let's redraw our frame picture with the frame names labeled.

TITLEBAR
NAVIGATION CONTENT

**You probably remember the other frame name, BOTTOM, from our first frame page. Its only purpose was to hold the nestedframe.html page, so it is no longer important.**

Now say we have a list of links on the navigation page. If we want a user to be able to click on those links and have them open in the CONTENT frame we have to use an attribute called target.

Here is how we would have to code the links on the Navigational Bar.html page:

<a href="page2.html" target="CONTENT">Goto Page 2</a>

HTML has several built-in targets. The _self target opens the page in the same window as the link that you clicked on. The _blank target opens the page in a new windows. The _top target opens the page in current browser window independent of the frameset. The_parent target would open in page in the original frameset, in this case the frame named BOTTOM.

Experimenting with frames is the easiest way to learn them. Be aware that you can include as many frames as you like in the original frameset statement. The example below has three columns.

<frameset cols="30%,*,20%" border="0" frameborder="0" framespacing="0">
Creative Commons License
This work is licensed under a Creative Commons License.

(<< Back)     [Home]     (Next >>)
Hosted by www.Geocities.ws

1