HTML Reference ยท Obsolete Elements
The <frame> element (obsolete)
The HTML <frame> element showed one document in a pane of a frameset. Learn why frames are obsolete and how to build the same layouts with CSS or iframes.
The <frame> element defined one pane inside a <frameset>. Each frame loaded a separate document from its src attribute, and its name let links elsewhere load pages into it with target. A typical site kept a navigation menu in one frame and the content in another.
Why it's obsolete
Frames caused lasting problems. The address bar showed the frameset's URL, not the page being read, so bookmarking, sharing and the back button behaved badly. Search engines indexed individual frames without their surroundings, small screens had no room for side-by-side panes, and screen reader users had to navigate between several documents. HTML5 made <frame> and <frameset> obsolete.
Browsers still render frames, but only in a document whose <body> is replaced by a <frameset>; anywhere else, <frame> is ignored.
Modern replacement
Build the layout as one page with CSS grid or flexbox. Repeat the navigation on each page (server-side includes or a static site generator make that easy). When you really need to embed another document, use <iframe>.
<!-- Before: obsolete --> <frameset cols="200,*"> <frame src="menu.html" name="menu"> <frame src="home.html" name="main"> </frameset>
Technical summary
| Status | Obsolete (non-conforming) |
| Replacement | CSS layout, or <iframe> for embedding a document |
| Still rendered by browsers | Partly; only inside a <frameset> that replaces <body> |
Related
<frameset>โ the obsolete container of frames<noframes>โ the obsolete fallback for frames<iframe>โ embed one document inside another- Lesson: Deprecated and Obsolete Features
- Lesson: Iframes