[HTML Tutorial]

Ken Ward's HTML Tutorial

The frames in the frameset

framesRows1.gif (1337 bytes)The picture on the left is a frames page with three frames. The page is divided first into rows and then into columns. The frames have tags of their own and they have certain options. You can allow the user to scroll the pages, resize the frames, or send hyperlinks to different pages.

You can also prevent the user from scrolling or resizing your frames. You can let the hyperlinks load pages in the same frame as the hyperlink.

Let's look at the code for the rows example we used last time and put in some more options for the frames. Here is the code we used last time, with some options added:

 

<html>

<head>

<title>

New Page 4

 

</title>

</head>

<!-- #######################

The page doesn't start with <body> tags because it is a frames page

####################### -->

<frameset rows="90,*">

<!-- #######################

We start with a frameset which divides the page into rows.

rows="90,*" means that the first row is 90 pixels (You could use percentages, such as 15%)

and the second row is what is left (*) of the page. The browser calculates this value for us.

####################### -->

<frame name="TOP" id="TOP" scrolling="no" noresize="noresize" target= "bottom" src=MyTopPage.htm" border="1">

<!-- #######################

Above is the first frame which will hold a file MyTopPag.htm. The frame has a name. Its name is TOP. The name is used in scripting and to tell hyperlinks where to load pages. (The id is present to make the page compatible with XHTML. The "name" is deprecated, and when present must be accompanied with an id for XHTML). This frame does not allow scrolling and does not allow the user to resize the page. Any hyperlinks in this frame will load pages in the frames named BOTTOM. In the first frameset you can specify the border property - 0 for no border, 10 for a very thick one!

####################### -->

####################### -->

 

<frame name="BOTTOM" target="TOP" scrolling="yes" src="MyBottomPage.htm" />

<!-- #######################

The second frame holds the page MyBottomPage.htm. Because we do not allow resizing in the top frame, then resizing will not occur here (for logical reasons). You can, however, scroll this page. Any hyperlinks in this frame will load pages in the frame called TOP.

####################### -->

</frameset>

Now lets learn how we can divide up the frames page even more.

[Next: Columns in Rows]

[HTML Tutorial][Framesets][Frames in Frameset][Columns in Rows]