HTML frameset Tag

The HTML <frameset> tag defines a set of frames within a web page. It specifies the layout of multiple frames, each containing separate HTML documents, enabling the creation of multi-pane layouts for displaying content.

Note: The <frameset> tag is not supported in HTML5.

Syntax: 

<frameset cols = "pixels|%|*">


Attributes: The list of frameset attributes are given below: 

AttributeDescription
colsDefines the number of columns and their size within the frameset tag, creating vertical frames in the web browser.
rowsDefines the number of rows and their size within the frameset tag, creating horizontal frames in the web browser.
borderSpecifies the width of the border of each frame in pixels. A value of 0 indicates no border.
frameborderSpecifies whether a three-dimensional border should be displayed between frames. Values: 0 (no border) or 1 (border).
framespacingSpecifies the amount of spacing between frames in a frameset, denoted in pixels.

Below examples illustrate the <frameset> element in HTML:

Example : In this example we defines a frameset with three rows, each displaying different content from external sources. The frames provide structured layout, with a fallback message for browsers that don’t support frames.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>frameset attribute</title>
</head>

<!-- frameset attribute starts here -->
<frameset rows="20%, 60%, 20%">
    <frame name="top" src="attr1.png" />
    <frame name="main" src="gradient3.png" />
    <frame name="bottom" src="col_last.png" />
    <noframes>

        <body>The browser you are working does not
            support frames.</body>
    </noframes>
</frameset>
<!-- frameset attribute ends here -->

</html>

Output: 
The above example basically used to create three horizontal frames: top, middle, and bottom using row attribute of frameset tag, and the noframe tag is used for that browser that doesn’t support noframe. 
 


Example : In this example we defines a frameset with three columns, each displaying different content from external sources. A fallback message is provided for browsers that don’t support frames.
 

HTML
<!DOCTYPE html>
<html>

<head>
    <title>frameset attribute</title>
</head>

<frameset cols="30%, 40%, 30%">
    <frame name="top" src="attr1.png" />
    <frame name="main" src="gradient3.png" />
    <frame name="bottom" src="col_last.png" />
    <noframes>

        <body>The browser you are working does
            not support frames.</body>
    </noframes>
</frameset>

</html>

Output: 
The above example basically used to create three vertical frames: left, center, and right using col attribute of frameset tag. 
 


Supported Browsers: 


Contact Us