Figure 1: framed page & HTML files |
The second file, frintro1.html, is the file that is loaded
into the first frame, and the third file frintro2.html is
loaded into the second frame.
Let's take these in order: The HTML for framesintro.html is
shown in figure 2.
<html> <head> <title>Frames Intro</title> </head> <frameset cols="30%,*"> <frame src="frintro1.html" name="sidebar"> <frame src="frintro2.html" name="main"> </frameset> </html> |
Figure 2: HTML for framesintro.html |
The <frameset> tag defines the frames in the document, in this case, one column using 30% of the navigator window and a second one using the remaining space ("*" -- note that the same effect could be obtained with the frameset tag <frameset cols="30%,70%">). Instead of a </body> tag, there is a </frameset> tag. In the frameset, the source files for two frames are defined with frame tags.
<html> <head> <title>Frames Review</title> </head> <body bgcolor="white"> <b>Intro Menu</b> <p> <a href="frintro2.html" target="main">Intro page</a> <p> <a href="frintro3.html" target="main">Workshop Frames page</a> etc. </body> </html> |
Figure 3: HTML for frintro1.html |
The source for the page frintro1.html is shown in
Figure 3. This is the HTML file that is loaded into the left
frame in Figure 1. Note:
> This is a regular, complete, HTML file
> The links (anchors) have a target
attribute.
The target attribute of the link indicates which frame to
load the linked file into -- the name is defined in the
frame tag, as shown in Figure 2.
The file frintro2.html is also an ordinary HTML file similar to frintro1.html. It too may contain links with the target attribute.
Notes on the target attribute
Top of Page |