HTML <frameset> Tag

The <frameset> tag defines the structure of a frame (zone in the browser window, where we can load another web page), number of columns and rows, and also how many percent/pixels it will occupy in a frame.

The <frameset> is a deprecated HTML tag.

You can use the <iframe> or <div> tags with different CSS properties for getting the same result.

The pages that contain frames can be validated only if the <!DOCTYPE> is set to XHTML Frameset DTD or HTML Frameset DTD.

Syntax

The <frameset> tag comes in pairs. The content is written between the opening (<frameset>) and closing (</frameset>) tags.

The <frameset> tag can contain one or several <frame> tags․ It is allowed to nest one <frameset> tag in another if it is necessary to divide the windows into smaller ones.

The frameset document uses the <frameset> element instead of the <body> element. The frameset element may not contain any content, but instead it defines and names frames arranged in rows and/or columns.

Example of the HTML <frameset> tag:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <frameset cols="50%,50%">
    <frame src="https://www.w3docs.com/learn-html/html-basic.html">
    <frame src="https://www.w3docs.com/learn-css/css-syntax.html">
  </frameset>
</html>

Result

frameset example

Example of the HTML <frameset> tag with the rows attribute:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <frameset rows="30%,40%,30%">
    <frame src="https://www.w3docs.com/learn-javascript.html">
    <frame src="https://www.w3docs.com/learn-git.html">
    <frame src="https://www.w3docs.com/learn-php.html">
  </frameset>
</html>

Attributes

Attribute Value Description
cols pixels
%
*
Defines the number and the size of frame columns.
Not supported in HTML5.
rows pixels
%
*
Defines the number and the size of frame rows.
Not supported in HTML5.

The <frameset> element also supports the Global Attributes.

Browser support

chrome edge firefox safari opera

Practice Your Knowledge

What is the function of the HTML <frameset> tag?

Quiz Time: Test Your Skills!

Ready to challenge what you've learned? Dive into our interactive quizzes for a deeper understanding and a fun way to reinforce your knowledge.

Do you find this helpful?