<frame> or <frameset>. These elements are obsolete and are not part of modern HTML. This page keeps the historical advantages and disadvantages for learners and for developers maintaining older pages.HTML frames were once used to divide one browser window into several independently loaded documents. A navigation frame could remain visible while another frame changed content. That solved some layout and reload problems on early websites, but it also created major usability, accessibility, navigation and maintenance problems.
Today, use normal HTML documents with modern CSS for page layout, templates or includes for shared headers and navigation, and <iframe> only when you genuinely need to embed another document inside the current page.
Older HTML allowed a <frameset> document to divide the browser window into areas. Each <frame> loaded a separate HTML document.
<!-- Historical example: obsolete in modern HTML -->
<frameset cols="25%,75%">
<frame src="menu.html" name="menu">
<frame src="content.html" name="content">
</frameset>
This pattern is useful to recognize when reading old source code, but it should not be used as the structure for a new website.
The original appeal of frames came from problems that were common on early websites. Historically, frames could provide these benefits:
The disadvantages are the main reason frames disappeared from modern page architecture.
The browser's address bar normally represented the outer frameset rather than the exact combination of documents visible inside it. That made deep linking, sharing and bookmarking a particular view difficult. Browser Back/Forward behavior could also become confusing. For modern history behavior, see the JavaScript History object tutorial.
Several independently navigable documents inside one browser window could make orientation and navigation harder, particularly for keyboard and assistive-technology users. Clear document structure is easier to provide with normal semantic HTML.
Printing the exact combined view of multiple frames was less predictable than printing a normal page. Sharing a URL also did not necessarily reproduce the same state that the user was viewing.
Frame dimensions and independent scrolling areas are poorly suited to responsive layouts. They also split one user experience across several documents, making navigation, styling and maintenance more complicated.
Because the outer frameset and the documents loaded inside it were separate URLs, search engines and users could reach a child document without the surrounding navigation, or encounter a frameset whose visible state was not represented by one clear URL.
<iframe> when embedding is actually the correct relationship, such as a map, video, external application or another self-contained document.<frame> and <frameset> were used to build the page itself out of multiple documents. <iframe> is different: it embeds another document inside a normal modern HTML page.
<iframe
src="example.html"
title="Example embedded document"
loading="lazy">
</iframe>
An iframe is therefore not a general replacement for frame-based page layout. Use it only when the page needs an embedded browsing context. See the HTML iframe tutorial for current usage and accessibility considerations.
If you are maintaining a legacy application, you may still need to understand frame-specific attributes and behavior before migrating the layout. The following Plus2net pages are retained as legacy references:
Treat these pages as documentation for old code, not as recommended patterns for new projects.
Old browsers may still render some frame-based pages for compatibility, but <frame> and <frameset> are obsolete and should not be used in new HTML.
Historically, frames let one part of the browser remain visible, such as navigation, while another independently loaded document changed.
Frames separate one user experience into multiple documents, which creates problems with navigation state, URLs, accessibility, responsive design, printing and maintenance.
Usually no. Rebuild the page as one normal HTML document with modern layout techniques. Use an iframe only when you specifically need to embed another document.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.
| honoremut | 27-10-2014 |
| Cool staff | |