Description
The HTML element <frameset>
is used to define a frameset, which is a collection of frames, each embedding a web page.
This element is not supported in HTML5 and you should avoid using it in the markup. Instead, use the <iframe>
element.
The below table summarizes its usage.
Usage Details | |
Placement | It is displayed as a Block element. |
Contents | It can contain the elements <frame> , <noframes> , <frameset> . |
Tags | Both the opening and closing tags are required. |
Versions | HTML 4, 4.01 This element is deprecated in HTML 4.01 and obsolete since HTML5, so avoid using this element in your markup. Instead, use the <iframe> element. |
Syntax
Here is the basic syntax of the <frameset>
element.
<frame rows="[ number | percentage | * ]" cols="[ number | percentage | * ]"></frameset>
Examples
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example - HTML Element frameset</title>
</head>
<body>
<!-- This elements frame and frameset are obsolete and not valid in HTML5, so avoid using them in your markup -->
<frameset rows="*,*">
<frame src="https://www.randomcodez.com" name="home">
<frame src="https://www.randomcodez.com/about" name="about">
</frameset>
</body>
</html>
Attributes
The following table shows the list of supported and unsupported attributes for the <frameset>
element.
Attribute Type | Details |
Element-Specific Attributes | The tag <frameset> has some element-specific attributes listed in the below table. |
Global Attributes | Like all other HTML tags, the tag <frameset> supports the HTML Global Attributes. |
Event Attributes | The tag <frameset> also supports the HTML Event Attributes. |
Here is a list of attributes that are specific to the <frameset>
element.
Attribute | Value | Required | Description |
rows |
number in pixels, %, * | Yes | Specifies the layout of horizontal frames. It is a comma-separated list of pixels in number, percentages, and relative lengths. The default value is 100%, meaning one row. |
cols |
number in pixels, %, * | Yes | Specifies the layout of vertical frames. It is a comma-separated list of pixels in number, percentages, and relative lengths. The default value is 100%, meaning one column. |
Browser Compatibility
The tag <frameset>
is supported in all modern browsers.
- Google Chrome 1+
- Internet Explorer or Edge 3+
- Firefox 1+
- Apple Safari 1+
- Opera 4+