HTML <frame> Tag

Beginner
6 min read
Updated: Oct 2026
4 examples
Live preview

Definition and Usage

The <frame> element defined one pane inside a <frameset>. Each pane loaded another HTML document via src.

Do not use it in new pages. Embed documents with <iframe>, and build split layouts with CSS Grid or Flexbox. Old documents sometimes paired frames with <noframes> for browsers without frame support.

Deprecated · Obsolete.

Removed from the HTML living standard. Avoid in every new project — prefer <iframe> or CSS layout.

Not the same as <iframe>.

<frame> only belonged inside <frameset> (no normal <body>). <iframe> sits in the page flow and is valid HTML5.

HTML Syntax

syntax.html
<frame src=" url">

Historical void-style element inside <frameset> (not inside <body>). Prefer this modern approach when you need an embed:

prefer.html
<iframe src="panel.html" title="Panel"></iframe>

Attributes

Legacy attributes you may see in old frameset pages. Do not use them in new work.

AttributeDescriptionTry it
srcURL of the document to show in the paneTry it
nameFrame name for target on linksTry it
noresizeDeprecated. Boolean — stopped users from resizing the paneTry it
scrollingDeprecated. yes, no, or auto scrollbarsTry it
frameborderDeprecated. 0 or 1 border around the paneTry it
marginheightDeprecated. Top/bottom margin inside the frame (pixels)Legacy only
marginwidthDeprecated. Left/right margin inside the frame (pixels)Legacy only

Global Attributes

The <frame> tag also supports the Global Attributes in HTML.

Live Preview

Compare a concept of a two-pane frameset with a real modern <iframe> embed. HTML5 pages cannot run a live <frameset>.

Study-only. Ship <iframe> or CSS layout — never <frame>.

Preview

Concept panes — not a real frameset.

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Legacy Frameset with <frame>

Historical document shape: <frameset> instead of <body>. Recognize it; do not ship it.

HTML
<frameset cols="30%,70%">
  <frame src="nav.html" name="nav">
  <frame src="main.html" name="main">
  <noframes>
    <p>This page used frames. Open nav.html and main.html separately.</p>
  </noframes>
</frameset>
Try It Yourself

How It Works

  1. Replace <body> with <frameset> in old documents.
  2. Set cols or rows to size the panes.
  3. Add one <frame> per pane with src pointing to a document.
  4. Optional <noframes> for a text fallback — still obsolete today.

Example 2 — Named Frames and target

Links used target="main" so navigation stayed in one pane. Historical pattern only.

HTML
<!-- In nav.html -->
<a href="about.html" target="main">About</a>

<!-- In the frameset document -->
<frameset cols="200,*">
  <frame src="nav.html" name="nav">
  <frame src="home.html" name="main">
</frameset>
Try It Yourself

How It Works

  1. Give the content pane a name (for example main).
  2. Set the link target to that same name.
  3. Clicking the link replaced only that pane’s document.
  4. Do not rebuild this. Single-page navigation or an <iframe> is clearer and more accessible.

Example 3 — Replace with <iframe>

Valid HTML5 embed inside a normal page. Always include a descriptive title.

HTML
<iframe
  src="panel.html"
  title="Help panel"
  width="320"
  height="200"
></iframe>
Try It Yourself

How It Works

  1. Keep a normal <body> — no frameset document.
  2. Add <iframe> with src (or srcdoc for inline HTML).
  3. Set title so assistive tech can name the embed.
  4. Sandbox untrusted content when needed — see the <iframe> guide.

Example 4 — CSS Split Layout (No Frames)

Two panes of your own content — no nested documents required.

HTML
<div class="layout">
  <nav>Sidebar links</nav>
  <main>Page content</main>
</div>

<style>
  .layout {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 0.5rem;
  }
</style>
Try It Yourself

How It Works

  1. Use semantic regions such as <nav> and <main>.
  2. Lay them out with CSS Grid (or Flexbox) instead of frameset columns.
  3. Keep one document so bookmarks, search, and screen readers work normally.
  4. Reach for <iframe> only when you truly need a nested browsing context.

Edge Cases & Pitfalls

Most problems come from treating obsolete frames like modern HTML, or confusing them with iframe.

obsolete

No <body> with frameset

Legacy frameset documents used <frameset> instead of <body>. Mixing both was invalid even then.

a11y

Hard for assistive tech

Multiple documents in one window made titles, focus, and reading order confusing. Prefer one page or a titled <iframe>.

seo

Weak for search and sharing

Each pane had its own URL. Bookmarks and crawlers often missed the “full” layout users saw.

naming

frame ≠ iframe

Do not rename <iframe> to <frame>. Only <iframe> is allowed in modern HTML.

attrs

Skip presentation attributes

scrolling, frameborder, marginwidth, and noresize are legacy. Use CSS on modern embeds instead.

Browser Support

Authors must not use <frame>. Engines may keep limited legacy behavior for old documents; HTML5 sites should use <iframe> or CSS.

✓ Deprecated · Obsolete

<frame>

Obsolete in the HTML living standard. Do not rely on frameset support in modern documents. Migrate to iframe for embeds and CSS for split layouts.

N/A Do not use in new HTML
Google Chrome Legacy only
Do not use
Mozilla Firefox Legacy only
Do not use
Apple Safari Legacy only
Do not use
Microsoft Edge Legacy only
Do not use
Opera Legacy only
Do not use
Samsung Internet Legacy only
Do not use
Internet Explorer Legacy
Do not use
<frame> Obsolete (use &lt;iframe&gt; / CSS)

Bottom line: Recognize <frame> in old markup, then replace with <iframe> or CSS. Never add frame to new documents.

Key Takeaways

  • Role: <frame> was one pane inside <frameset> — now obsolete.
  • Replace embeds: use <iframe> with a clear title.
  • Replace layouts: use CSS Grid or Flexbox in one document.
  • Study only: know src / name so you can read legacy codebases.

One line: never write <frame>; write <iframe> or CSS for panes.

Default CSS Settings

<frame> was a replaced pane inside a frameset. There is no useful modern default to copy. For embeds today, browsers treat iframe roughly like:

default.css
iframe:not([hidden]) {
  border: 2px inset;
  display: inline-block;
  overflow: clip;
  /* width / height from attributes or CSS */
}

Style size and borders with CSS on iframe. Do not revive frameborder or scrolling on obsolete <frame>.

Frequently Asked Questions

The frame element defined one pane inside a frameset. Each frame loaded its own HTML document so the browser window could show a split layout (for example a sidebar and main content).
No. frame and frameset are obsolete and removed from the HTML living standard. Do not use them in new projects.
frame lived only inside frameset and split the whole window — it is obsolete. iframe embeds another document inside a normal page body and is valid HTML5.
Use iframe when you need to embed another page, and CSS Grid or Flexbox when you need a multi-pane layout of your own content.
Framesets hurt accessibility, bookmarking, printing, and SEO (each pane is a separate document). Modern layout and iframe cover the same goals more safely.
Some engines keep limited legacy support for very old documents, but HTML5 documents with a body do not use framesets. Always migrate to iframe or CSS.

Next: frameset

See the obsolete container that held multiple frame panes.

frameset tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful