HTML Tags – Frameset Tag


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.

SnoAttributesValueDescription
1cols*
%
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.
2rows*
%
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.

SnoAttributesValueDescription
1idunique_nameDeclared unique id for an element.
2classclass_nameDeclared one or more classnames for an element.
3stylestylesCSS inline styles specify an element.
4titletitleSpecify 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

SnoBrowserSupport
1ChromeYes
2FirefoxYes
3EdgeYes
4OperaYes
5SafariYes
6Internet ExplorerYes