🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

<frameset>

AI & DATA SCIENCE // frameset-tag

The deprecated <frameset> element replaced <body> entirely to define a grid of <frame> panes, splitting the browser window into multiple independent documents.

Syntax

<!-- Deprecated: -->
<html>
<frameset cols="200,*">
  <frame src="sidebar.html">
  <frame src="main.html">
</frameset>
</html>

Deep Dive Course

**`<frameset>`** used its **`rows`** or **`cols`** attribute (comma-separated sizes, where `*` means 'take remaining space') to define a grid of panes, each filled by a `<frame>` child loading its own separate HTML document. A page using `<frameset>` couldn't have a normal `<body>` at all — the two were mutually exclusive. Along with `<frame>`, it was removed from HTML5 due to serious navigation, bookmarking, accessibility, and SEO problems, and modern browsers no longer render it at all.

1Understanding <frameset>

`<frameset>` used its `rows` or `cols` attribute (comma-separated sizes, where * means 'take remaining space') to define a grid of panes, each filled by a <frame> child loading its own separate HTML document. A page using <frameset> couldn't have a normal <body> at all — the two were mutually exclusive. Along with <frame>, it was removed from HTML5 due to serious navigation, bookmarking, accessibility, and SEO problems, and modern browsers no longer render it at all.

💡

A page using <frameset> has NO <body> element — the two are mutually exclusive, which is itself a strong sign of how fundamentally different this old layout model was from normal HTML documents.

editor.html
<!-- Historical frameset defining a sidebar + main content layout -->
<frameset cols="200,*">
  <frame src="nav.html" name="navFrame">
  <frame src="welcome.html" name="mainFrame">
</frameset>
localhost:3000

2Practical Example

Here is a real-world application of <frameset> showing how it is used in production HTML.

editor.html
<!-- Modern equivalent using CSS Grid within a normal <body> -->
<body style="display: grid; grid-template-columns: 200px 1fr;">
  <nav>Sidebar navigation</nav>
  <main>Main content</main>
</body>
localhost:3000

3Best Practices

Follow these guidelines when working with <frameset>:

1. Never use <frameset> — it's entirely unsupported by every modern browser

2. Use CSS Grid or Flexbox to achieve equivalent multi-panel layouts within a single normal document

3. If maintaining a legacy site using frameset, plan a full rewrite to a standard <body>-based layout with CSS

⚠️

Tip: A page using <frameset> has NO <body> element — the two are mutually exclusive, which is itself a strong sign of how fundamentally different this old layout model was from normal HTML documents.

editor.html
<!-- Historical frameset defining a sidebar + main content layout -->
<frameset cols="200,*">
  <frame src="nav.html" name="navFrame">
  <frame src="welcome.html" name="mainFrame">
</frameset>
localhost:3000

Examples

Example 01Basic Usage
<!-- Historical frameset defining a sidebar + main content layout -->
<frameset cols="200,*">
  <frame src="nav.html" name="navFrame">
  <frame src="welcome.html" name="mainFrame">
</frameset>
Example 02Advanced Example
<!-- Modern equivalent using CSS Grid within a normal <body> -->
<body style="display: grid; grid-template-columns: 200px 1fr;">
  <nav>Sidebar navigation</nav>
  <main>Main content</main>
</body>

Best Practices

  • Never use — it's entirely unsupported by every modern browser
  • Use CSS Grid or Flexbox to achieve equivalent multi-panel layouts within a single normal document
  • If maintaining a legacy site using frameset, plan a full rewrite to a standard -based layout with CSS

Interview Question

Can a single HTML document use both <frameset> and <body>?

Hint: Think about what <frameset> actually replaces at the top level of the document.

No — <frameset> and <body> are mutually exclusive; a frameset-based document uses <frameset> in place of <body> entirely, since the frameset itself defines how the window's content area is divided. This is one of the clearest signs of how fundamentally different the old frame-based layout model was from the standard single-document HTML structure used ever since HTML5.

Exercises

EasyPractice using <frameset> in a real scenario.
View Solution
<!-- Historical frameset defining a sidebar + main content layout -->
<frameset cols="200,*">
  <frame src="nav.html" name="navFrame">
  <frame src="welcome.html" name="mainFrame">
</frameset>

Frequently Asked Questions

Can a single HTML document use both <frameset> and <body>?

No — and are mutually exclusive; a frameset-based document uses in place of entirely, since the frameset itself defines how the window's content area is divided. This is one of the clearest signs of how fundamentally different the old frame-based layout model was from the standard single-document HTML structure used ever since HTML5.

Related Functions

frame-tagnoframes-tag