What is HTML <frameset> tag ?
HTML <frameset> tag defines the frameset window.
HTML <frameset> element contains one or more <frame> elements.
HTML <frameset> tag remove in HTML5 specification.
How HTML <frameset> tag works ?
HTML <frameset> tag splits the browser window in several individual frames that can contain a separate HTML web document.
HTML <frameset> tag divides a web page into multiple sections or frames, and each frame can contain different web pages.
HTML <frameset> tag is used to specify the number of row and column inside frameset with their pixel of spaces. Each element is termed as HTML <frame>.
And HTML <frame> is a specific window or a frame, where we can load another web page.
We can use the “src” attribute to define the address of this web page.
A single web page can have several such frames.
Why is HTML <frame> tag used ?
HTML <frame> tag is used improve appearance and usability of a site.
Note: HTML <frame> tag as it is not supported in HTML5, instead we can use <iframe> or <div> with CSS to achieve similar effects in HTML.
HTML beginners tutorial !!!
Click to Learn More about – HTML Tutorial for beginners
Syntax:
<frameset cols = "pixels|%|*">
Frame1.html
<html>
<body style="background-color:green;">
<h2 align="center">Frame 1</h2>
</body>
</html>
Frame2.html
<html>
<body style="background-color:yellow;">
<h2 align="center">Frame 2</h2>
</body>
</html>
Main.html
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<frameset cols="50%,50%">
<frame src="frame1.html">
<frame src="frame2.html">
</frameset>
</html>
Output :
<frameset> Tag Attributes
HTML <frameset> tag support following specific attributes. All following attributes has been removed in HTML5.
Sno | Attributes | Value | Description |
---|---|---|---|
1 | cols | * % pixels | Specifies the number of columns and their width in a frameset. Default value is 100%. *: Allocated remaining size of the window. Eg. Create two vertical frames, use cols=”35%, *”. Here * will takes remaining size of the window. |
2 | rows | * % pixels | Specifies the number of rows and their height in a frameset. Default value is 100%. *: Allocated remaining size of the window. Eg. Create two horizontal frames, use cols=”40%, *”. Here * will takes remaining size of the window. |
Global Attributes
HTML <frameset> tag support following global attributes.
Sno | Attributes | Value | Description |
---|---|---|---|
1 | id | unique_name | Declared unique id for an element. |
2 | class | class_name | Declared one or more classnames for an element. |
3 | style | styles | CSS inline styles specify an element. |
4 | title | title | Specify extra details of element contain, this will display as a “tooltip” for an elements. |
Event Attributes
HTML <frameset> tag does not support any event attributes.
Browser Compatibility
Sno | Browser | Support |
1 | Chrome | Yes |
2 | Firefox | Yes |
3 | Edge | Yes |
4 | Opera | Yes |
5 | Safari | Yes |
6 | Internet Explorer | Yes |