frame
The obsolete <frame> element displayed a separate document inside a <frameset>. It is not part of modern HTML and should not be used for new sites.
What you will learn
- What the old
frameandframesetmodel did - Why frames are unsuitable for modern sites
- When to choose an
iframe, a normal link, or CSS layout
Historical syntax
<!-- Historical example: do not use for new work. -->
<frameset cols="25%,75%">
<frame src="menu.html" title="Menu">
<frame src="home.html" title="Content">
</frameset>
This model split a browser window into independently scrolling documents. It created problems with history, bookmarking, responsive layouts, search indexing, printing, and assistive technology.
Choose a modern alternative
iframe: embed a separate, external browsing context when that is truly required, such as a carefully sandboxed map or video.- Normal links: navigate to another document and preserve browser history and user control.
- CSS layout: arrange content from the same document with grid or flexbox.
Do not use an iframe merely to simulate a page layout. If you embed one, provide a useful title, consider sandbox, and ensure the embedded content is usable at small widths.