Frameset HTML

HTML <frameset> Tag

The HTML <frameset> Tag is not supported in HTML 5. It was used to specify a frameset in HTML, which holds one or more <frame> elements. The HTML <frame> element was used to specify an area in an HTML file to display another HTML web page within it. A web page is thus divided into multiple sections or frames. Nowadays, the HTML <iframe> tag can be used instead of the HTML <frameset> tag as it is now deprecated.

Syntax:

<frameset cols=" ">............</frameset>

Example 1:

<!DOCTYPE html>  
<html>  
<head>  
    <title>Example</title>  
</head>  
  <frameset cols="25%,50%,25%">  
    <frame src="frame1.html" >  
    <frame src="frame2.html">   
    <frame src="frame3.html">  
  </frameset>  
</html>

Frame1.html:

<!DOCTYPE html>  
<html>  
<head>  
    <style>  
       div{  
        background-color:crimson;   
        height: 400px;  
        }  
    </style>  
</head>  
<body>  
    <div style = "text-align: center; padding: 30px; color:white;">  
        <h2>HELLO WORLD!!</h2>  
        <p>I am the FIRST Frame.</p> 
    </div>  
 </body>  
</html>

Frame2.html:

<!DOCTYPE html>  
<html>  
<head>  
    <style>  
       div{  
        background-color:gray;   
        height: 400px;  
        }  
    </style>  
</head>  
<body>  
    <div style = "text-align: center; padding: 30px; color:black;">  
        <h2>HELLO WORLD!!</h2>  
        <p>I am the SECOND Frame.</p> 
    </div>  
 </body>  
</html>

Frame3.html:

<!DOCTYPE html>  
<html>  
<head>  
    <style>  
       div{  
        background-color:black;   
        height: 400px;  
        }  
    </style>  
</head>  
<body>  
    <div style = "text-align: center; padding: 30px; color:white;">  
        <h2>HELLO WORLD!!</h2>  
        <p>I am the THIRD Frame.</p> 
    </div>  
 </body>  
</html>

Explanation:

In the above example, we are using the HTML <frame> tag to create 3 vertical HTML frames within an HTML web page.

Tag Specific Attributes:

Attribute Value Uses HTML 5
cols Pixels

*

Used to define the number and size of columns in a frameset. Not Supported in HTML 5.
rows Pixels

*

Used to define the number and size of the rows in a frameset. Not Supported in HTML 5.

Supporting Browsers:

Chrome, IE, Firefox, Opera, and Safari.