Ever been to a website where two web pages are visible on the same browser window? Looks amazing doesn’t it? This is made possible by the usage of frames.
Frames are implemented by using the specified tags for frames. These are:
1. <frame>: Defines a sub window (a frame)
2. <frameset>: Defines a set of frames
3. <noframes>: Defines a ‘noframe’ section for browsers that do not handle frames
4. <iframe>: Defines an inline sub window (frame)
For now we will be using the <frameset> tag. As with the other tags that we have discussed so far, the frameset tag also needs to be closed by inserting </frameset>. The frameset tag is used along with some attributes to define the ratio by percentage or pixels that the browser window will be divided into.
Let’s demonstrate how frames work with the following beginner’s html frame tutorial. See this example.
<html>
<head>
<title>Test </title>
</head>
<body bgcolor=”green”>
<p align=”center”> hello!</p>
</body>
</html>
Save it as x.html.
<html>
<head>
<title>Test </title>
</head>
<body bgcolor=”blue”>
<p align=”center”> hello!</p>
</body>
</html>
Save it as y.html.
And finally, make a new html file with the following code:
<html>
<frameset cols=”50%,50%”>
<frame src=”c:\\x.html”>
<frame src=”c:\\y.html”>
</frameset>
</html>
Note: Don’t forget to give the exact address of the source files (like my x and y files were in C:\).
The next example demonstrates horizontal frames. The same x and y files will be used that we made in the previous one.
<html>
<frameset rows=”50%,50″>
<frame src=”c:\\x.html”>
<frame src=”c:\\y.html”>
</frameset>
</html>
HTML Frames
February 18th, 2008 · No Comments
Tags: HTML tutorials
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
You must log in to post a comment.