Saturday 28 September 2013

Using HTML Top, Bottom and Middle Frames in a Website

The Top/Middle/Bottom frame is perfect for placing a banner at the top of the page and yet allows your web site visitors traverse your web site using the Middle and bottom Frames It's also good to place the title of your web site and keep the title visible throughout your entire site. The bottom Frame can be used for Hotlinks to various pages on your web site and the middle frame will store the actual site contents.
The Frames code for a Top, Middle and Bottom Frame consists of Four HTML files.   First, is the Control HTML file which also contains the HTML for the web page to support browsers that do not support frames. Second is the source for the top frame. Third is the Source for the Middle Frame and finally the source for the bottom frame.  Below is an example of the HTML for all four files to create this type of a frame:
Controller HTML File:
<html>
<head>
<title>Controller HTML File</title>
</head>
<frameset rows="64,70%,*">
<frame name="top-frame" scrolling="no" noresize target="middle" src="top-frame.html">
<frame name="middle-frame" target="middle-frame" src="middle-frame.html" >
<frame name="bottom-frame" scrolling="no" noresize target="middle-frame" src="bottom-frame.html">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>

Top Frame HTML File (Save this file named top-frame.html):
                                                                   top-frame.html
<html>
<head>
<title>Top Frame</title>
<base target="middle">
</head>
<body>
<p>This is the Top Frame</p>
</body>
</html>

Middle Frame HTML File (Save this file named middle-frame.html):
                                                                     middle-frame.html
<html>
<head>
<title>Middle Frame</title>
<base target="bottom">
</head>
<body>
<p>This is the Middle Frame</p>
</body>
</html>

Bottom Frame HTML File (Save this file named bottom-frame.html)
                                                              bottom-frame.html
<html>
<head>
<title>Bottom Frame</title>
<base target="middle">
</head>
<body>
<p>This is the Bottom Frame</p>
</body>
</html>


The Web page you will call is going to be the Controller Frame.  The Controller frame will load up the other two web pages into the left and right frames based upon the src tag in the Control Frame HTML.  In the above example, be sure all four web pages reside in the same directory and are named accordingly.

No comments:

Post a Comment