Frameset Tag in HTML

0
155

The `<frameset>` tag in HTML is used to define a set of frames that divide a web page into separate sections or panes. Each frame can display a different web page or content, allowing users to interact with multiple pages within a single browser window. In this tutorial, we will discuss the `<frameset>` tag in HTML, its attributes, and how to use it to create framesets in a web page.

 Syntax

The `<frameset>` tag is a container tag that contains one or more `<frame>` tags. Its syntax is as follows:

<frameset rows=”value” cols=”value” framespacing=”value” frameborder=”value” border=”value” …>
<frame src=”url” name=”name” …>
<frame src=”url” name=”name” …>

</frameset>

Attributes

The `<frameset>` tag supports the following attributes:

– `rows`: Specifies the height of each row in the frameset. The value can be a list of percentages or pixels separated by commas. For example, `rows=”25%,75%”` creates a frameset with two rows, with the first row taking up 25% of the available space and the second row taking up 75%.
– `cols`: Specifies the width of each column in the frameset. The value can be a list of percentages or pixels separated by commas. For example, `cols=”20%,80%”` creates a frameset with two columns, with the first column taking up 20% of the available space and the second column taking up 80%.
– `framespacing`: Specifies the amount of space between each frame in the frameset. The value can be a number of pixels or a percentage. For example, `framespacing=”10″` creates a frameset with a spacing of 10 pixels between each frame.
– `frameborder`: Specifies whether or not each frame should have a border. The value can be `0` (no border) or `1` (border).
– `border`: Specifies the width of the border around the frameset. The value can be a number of pixels. For example, `border=”1″` creates a frameset with a 1 pixel-wide border.

Also Read:  Address Tag in HTML

Example

Here is an example of how to use the `<frameset>` tag to create a frameset in a web page:

<!DOCTYPE html>
<html>
<head>
<title>Frameset Example</title>
</head>
<frameset rows=”25%,75%”>
<frame src=”header.html” name=”header” scrolling=”no” noresize>
<frameset cols=”20%,80%”>
<frame src=”menu.html” name=”menu” scrolling=”yes” noresize>
<frame src=”content.html” name=”content” scrolling=”yes” noresize>
</frameset>
</frameset>
<body>
<p>This is the main content of the page.</p>
</body>
</html>

In this example, we have used the `<frameset>` tag to create a frameset with two rows and two columns. The first row contains a header frame, and the second row contains a frameset with a menu frame on the left and a content frame on the right.

Each `<frame>` tag specifies the source URL of the web page to be displayed in the frame, as well as a name, scrolling, and noresize attribute.

Finally, the main content of the page is displayed below the frames using normal HTML tags.

Conclusion

The `<frameset>` tag in HTML can be a powerful tool for creating dynamic and interactive web pages. By using framesets, you can divide a web

Leave a Reply