Independent Articles and Advice
Login | Register
Finance | Life | Recreation | Technology | Travel | Shopping | Odds & Ends
Top Writers | Write For Us


PRINT |  FULL TEXT PAGES:  1 2 3 4 5 6
Framing Your Web Pages 
 
by Scott Nesbitt August 08, 2005

Using <frame>

Now that we have the container, it's time to add the frames themselves using the <frame> tag. For the left frame, set up the frame like this:

<frame src="menu.htm" name="menu" scrolling="auto">

For the right frame, set up the frame like this:

<frame src="page1.htm" name="content" scrolling="auto">

Notice that the <frame> tags have the attributes src, name, and scrolling.  Frames have several other attributes, but these are generally the most widely-used ones.

The src attribute points to the file that appears in the frame. The left frame displays a menu from the file menu.htm. The right frame displays the first page of your content, page1.htm. You can, of course, name these files whatever you want. You have to create these files yourself; if they don't exist, the frames will be empty.

The name attribute is useful when linking from one frame to another. The name attribute is discussed later in the article. The scrolling attribute controls whether or not a frame has a scrollbar. You can set the attribute to no, yes, and auto. auto adds a scrollbar only if the contents of a frame go past the edge of the browser window.

Your Framed Page

When you put it all together, the code for the page looks like this:

<HTML>

<head>

<title>My First Framed Page</title>

</head>

<frameset cols="30%, 70%">

<frame src="menu.htm" name="menu" scrolling="auto">

<frame src="page1.htm" name="content" scrolling="auto">

</frameset>

</html>

Remember that the principles described in this article also apply to pages made up of rows.

PREV PAGE 1 2 3 4 5 6 NEXT PAGE

 




Home  |  Write For Us  |  FAQ  |  Copyright Policy  |  Disclaimer  |  Link to Us  |  About  |  Contact

© 2005 GoogoBits.com. All Rights Reserved.