The
<frame>tag in HTML was used to define a specific region within a<frameset>that could display a separate HTML document.
Frames allowed web developers to split the browser window into multiple sections, each loading a different webpage.
This tag is deprecated in HTML5 and replaced by more modern layout techniques using CSS Flexbox, Grid, or iframes.
Syntax
<frameset cols="50%,50%">
<frame src="left.html">
<frame src="right.html">
</frameset>Attributes
| Attribute | Description |
|---|---|
src | Specifies the URL of the document to be displayed in the frame. |
name | Assigns a name to the frame (used for linking). |
scrolling | Controls whether scrollbars appear (yes, no, or auto). |
noresize | Prevents resizing of the frame by the user. |
frameborder | Defines whether the frame has a border (1 or 0). |
marginwidth | Sets the left and right margins of the frame content. |
marginheight | Sets the top and bottom margins of the frame content. |
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Frame Tag Example</title>
</head>
<!-- Frameset replaces body when using frames -->
<frameset cols="50%,50%">
<frame src="https://freethings.org.in" name="leftFrame" frameborder="1" scrolling="auto">
<frame src="https://hindigems.com" name="rightFrame" frameborder="1" scrolling="auto">
</frameset>
<noframes>
<body>
<p>Your browser does not support frames. Please use a modern browser.</p>
</body>
</noframes>
</html>Output
Browser Output
There is no visible output in HTML5 browsers as the <frame> tag is not supported.
In older browsers, this code splits the window into two columns — each displaying a different webpage.
You can use the TryIt Editor to view how it worked in legacy browsers.
Browser Support
Chrome | Firefox | Edge | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| ❌No | ❌No | ❌No | ❌No | ❌No | ⚠️Partial |
No Major browser support for this <frame> tag.
Notes
- The
<frame>tag cannot be used inside the<body>tag — it must be used within a<frameset>. - Frames are deprecated due to accessibility, usability, and SEO issues.
- Use CSS layouts or
<iframe>for embedding external content instead.
Conclusion
The <frame> tag was once used to divide a webpage into multiple sections displaying separate documents.
It is now obsolete in HTML5 and replaced by modern layout methods like CSS Grid, Flexbox, or embedding techniques using <iframe>.