- Home
- /
- Tutorials
- /
- HTML Tutorial
- /
- HTML <frameset> Tag
HTML Tags
HTML <frameset> Tag
frameset split the browser window into several frames, each loading its own web page. It was popular in the late 1990s and is now obsolete. Modern browsers do not display framesets in HTML5 pages.
How it worked
A frameset page had no <body>. Instead, <frameset> divided the window into rows or columns, and each <frame> inside loaded a separate page, typically a menu on the left and content on the right.
Syntax
html
<frameset rows="value" cols="value">
<frame src="URL1">
<frame src="URL2">
</frameset>| Attribute | What it did |
|---|---|
| rows | Heights of the frames from top to bottom, like rows="100,*" |
| cols | Widths of the frames from left to right, like cols="25%,75%" |
| border, frameborder, framespacing | The lines between frames. Mostly non-standard. |
html
<!DOCTYPE html>
<html>
<head>
<title>HTML Frameset Example</title>
</head>
<frameset cols="50%,50%">
<frame src="https://wikipedia.com" name="leftFrame">
<frame src="https://hindigems.com" name="rightFrame">
</frameset>
</html>This would show two pages side by side, each taking half the window.
Why frames were dropped
- Bookmarks and links broke. The address bar showed the frameset page, not the page you were reading, so you could not bookmark or share it.
- Search engines got lost. They indexed the inner pages on their own, and visitors arrived without the menu.
- The back button was confusing, and frames did not work on small screens.
The modern replacement
Because <frameset> is no longer supported, use <iframe> with CSS for layout. This version runs in any current browser.
The modern replacement: <iframe>
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Modern Replacement for Frames</title>
<style>
body { margin: 0; font-family: Arial, sans-serif; }
.frame-row { display: flex; height: 220px; }
.frame-row iframe { flex: 1; border: 1px solid #cbd5e1; }
</style>
</head>
<body>
<div class="frame-row">
<iframe src="/samples/frame-left.html" title="Left panel"></iframe>
<iframe src="/samples/frame-right.html" title="Right panel"></iframe>
</div>
</body>
</html>Today, a shared menu is part of every page, built with your site's templates, and laid out with CSS Grid or Flexbox. When you really need to show another page inside yours, use an iframe.
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
|---|---|---|---|---|
| No | No | No | No | No |
Current browsers ignore <frameset> in pages with an HTML5 doctype. Some still render it in very old documents for compatibility, but it is not part of HTML anymore.
HTML <frameset> Tag exercises
Two panels side by side
The frameset element is gone. Make a div with the class row that holds two iframes: https://html5andcss3.org/samples/frame-left.html named Menu and https://html5andcss3.org/samples/frame-right.html named Content. With a style block make the row a flex container.
Result
