Saturday 28 September 2013

Frames in HTML Right Frame in HTML and Left Frame in HTML

The Frames code for a Left and right Frame consists of three 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 Left Frame and finally the source for the right frame.  Below is an example of the HTML for all three files to create this type of a frame:
Controller HTML File:

<html>
<head>
<title>Frames Control Web Page</title>
</head>
<frameset cols="150,*">
<frame name="left-frame" src="left-frame.html">
<frame name="right-frame" src="right-frame.html">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>


Left Frame HTML File (Save this file named left-frame.html):
                                                                    left-frame.html
<html>
<head>
<title>Left Frame Web Page</title>
<base target="main">
</head>
<body>
<p>This web page 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 Web Page</title>
<base target="main">
</head>
<body>
<p>This web page 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 three web pages reside in the same directory and are named accordingly.


No comments:

Post a Comment