HTML <frameset> Element

The <frameset> element was historically used to divide the browser window into multiple frames, with each frame displaying a separate HTML document. Instead of a normal <body>, a frameset document defined rows or columns containing one or more <frame> elements.

Historical Syntax

Older frameset documents may contain markup similar to the following:

<frameset cols="25%,75%">
  <frame src="navigation.html">
  <frame src="content.html">
</frameset>

The cols attribute divided the browser window into two vertical areas. Each <frame> then loaded a separate HTML document into one of those areas. This code is shown for historical reference only and should not be used in modern HTML.

Attributes

The <frameset> element historically supported element-specific attributes that determined how the browser window was divided. These attributes are obsolete along with the element and are included here to help identify and understand older HTML source code.

Attribute Description
cols Divided the frameset into vertical columns and specified the width of each column.
rows Divided the frameset into horizontal rows and specified the height of each row.

Historical Use

The <frameset> element controlled the overall arrangement of a frames-based webpage. Authors could divide the browser window horizontally with rows, vertically with cols, or create more complicated layouts by nesting one frameset inside another.

Frame dimensions could historically be expressed using fixed pixel values, percentages, or relative values using an asterisk. For example, cols="200,*" could reserve 200 pixels for one frame and give the remaining space to another.

A common website design placed navigation in a narrow frame and loaded different pages into a larger content frame. Because the navigation document remained loaded while the content frame changed, authors could avoid repeating the navigation markup on every page.

Why It Became Obsolete

Framesets created a webpage from several independent documents rather than presenting the page as one coherent HTML document. This caused problems with URLs, bookmarking, browser history, printing, search engines, accessibility, navigation, and linking directly to the content a visitor was viewing.

Frames-based layouts also became unnecessary as HTML and CSS evolved. Common navigation and page sections can now be included within a normal document, while CSS Grid and Flexbox provide powerful ways to arrange those sections without creating separate browsing contexts.

The <frameset>, <frame>, and <noframes> elements are obsolete in modern HTML.

Modern Alternative

Use normal HTML elements to structure the page and CSS to control its layout. For example, a navigation area and main content area can be arranged into columns with CSS Grid.

<div class="page-layout">
  <nav>
    <a href="/index.html">Home</a>
    <a href="/services.html">Services</a>
    <a href="/contact.html">Contact</a>
  </nav>
  <main>
    <h1>Welcome</h1>
    <p>The main page content appears here.</p>
  </main>
</div>
.page-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
}
Play in Editor

The modern <iframe> element is available when another document genuinely needs to be embedded within a webpage, but it is not a replacement for using framesets to construct the overall layout of a website.

Legacy Browser Support

Framesets were widely supported by browsers when frames-based websites were common. Modern browsers retain support for displaying many older frameset documents for compatibility with existing webpages, but this legacy behavior does not make <frameset> valid modern HTML.

Existing frameset-based websites should be converted to normal HTML documents with CSS-based layouts when they are updated.

For detailed legacy browser compatibility information, see Can I Use: HTML <frameset> Element .

The <frameset> element contained obsolete <frame> elements and could be accompanied by the obsolete <noframes> element. The modern <iframe> element serves the different purpose of embedding another document within a normal webpage.

Specifications

The <frameset> element is listed as an entirely obsolete, non-conforming feature in the WHATWG HTML Living Standard . Modern websites should use normal HTML document structure and CSS for page layout.