|
How to create Frames in HTML
HTML frames allows you to present multiple HTML documents in a single browser window at the same time. Each HTML document in the window is known as a frame. With frames, it is possible to split an html browser window into segments, each of which can show different documents. Typically, frames are used to have a menu in one frame whereas content in another frame. The frameset is an element that holds one or more frame elements. It is defined by the <frameset> tag. It specifies the number of rows and columns in the frameset and how many pixels of space will be occupied by each of them. The <frame> tag defines one particular frame or window within a frameset.
To create HTML frames use the following code:
The frameset (example1.html):
<html>
<head>
<title>Frameset <title>
</head>
<frameset cols = "25%, *">
<frame src =" left_example.html” />
<frame src =" right_example.html” />
</frameset>
</html>
The left frame (left_example.html):
<html>
<body style="background-color: yellow">
<p>This is the left frame (left_example.html).</p>
</body>
</html>
The right frame (right_example.html):
<html>
<body style="background-color: green">
<p>This is the right frame (right_example.html).</p>
</body>
</html>
This will be the result:
This is the left frame (left_example. html). |
This is the right frame (right_example.html). |
|
|
|
|
|