Saturday 28 September 2013

HTML Top Frames, HTML Right Frames, HTML Left Frames

The Top/Left/Right 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 left an right frames.  It's also good to place the title of your web site and keep the title visible throughout your entire site.
The Frames code for a Top, Left and right 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 Left Frame and finally the source for the right 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 Page</title>
</head>
<frameset rows="64,*">
<frame name="top-frame" scrolling="no" noresize target="right-frame" src="top-frame.html">
<frameset cols="150,*">
<frame name="left-frame" target="right-frame" src="left-frame.html">
<frame name="right-frame" src="right-frame.html">
</frameset>
<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="right-frame">
</head>
<body>
<p>This is the Top Frame</p>
</body>
</html>

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

Right Frame HTML File (Save this file named right-frame.html)
                                                                   right-frame.html
<html>
<head>
<title>Right Frame</title>
</head>
<body>
<p>This is the Right 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