October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
ThatPainter
frames

Designing with Frames: A Legacy HTML Introduction

A clear guide to how HTML frames divided browser windows, targeted links and handled fallbacks, plus why frames are obsolete for new pages.

By ThatPainter Team 3 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ThatPainter is reader-supported. When you buy through links on our site, we may earn an affiliate commission. Learn More

HTML frames divided a browser window into regions that loaded separate documents. A FRAMESET defined the divisions, each FRAME loaded a page into one region, and links could target a named frame. This is a historical technique, not a choice for new websites: the current WHATWG HTML Standard classifies frame, frameset, and noframes as obsolete and says authors must not use them.

How a frameset worked

In the older model, the frameset page did not contain the content shown in each region. Instead, it described the browser window’s layout and named the separate documents to load. A frame could show a navigation menu while another showed the page selected from that menu.

A period-style example looks like this:

<frameset cols="25%,75%">
  <frame src="menu.html" name="menu">
  <frame src="welcome.html" name="content">
</frameset>

The cols attribute divides the window into columns; rows could divide it into horizontal bands instead. The values specify the relative sizes of the regions. Each src names a separate HTML document, and each name gives a frame an address that links can target. This markup is shown only to explain legacy pages. It is not conforming markup for a new page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

How links loaded a page into a chosen frame

A link in the menu document could load its destination in the frame named content by using that name as its target:

<a href="about.html" target="content">About</a>

Without a target, the link normally navigated the document containing it. Legacy pages could set a default destination for links with a BASE TARGET declaration in the document head; an individual link’s target could specify a different destination.

How one link changed more than one frame

“How do I make one link change two frames?” In a frameset, a single ordinary link target selects one destination frame. The historical workaround was JavaScript: a link called a function that assigned new page URLs to multiple named frames.

<script>
function showPages() {
  parent.frames["menu"].location = "menu-new.html";
  parent.frames["content"].location = "article.html";
}
</script>

<a href="article.html" onclick="showPages(); return false;">
  Open article
</a>

Here, parent.frames refers to the frames in the containing frameset, and setting a frame’s location navigates it to another document. Returning false prevents the link’s normal navigation after the script runs. This illustrates a historical technique; it is not a modern pattern to adopt. Scripts can fail or be unavailable, so a link that depends on this behavior can also fail to provide useful navigation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What NOFRAMES was for

NOFRAMES provided alternate content for browsers that could not display a frameset. Legacy authors could place a message and ordinary navigation links inside it:

<noframes>
  <body>
    <p>Browse the site:</p>
    <a href="about.html">About</a>
  </body>
</noframes>

Some older frame-based sites also included discreet navigation links in their content documents, so users arriving directly at a document had a way to reach other sections. These fallbacks matter when maintaining old sites, but noframes itself is obsolete in current HTML.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to use instead today

The current WHATWG HTML Standard says authors must not use frame, frameset, or noframes. It points to two different approaches, depending on what the page needs:

  • Use an iframe with CSS when a page needs to embed another document within its content. An iframe is an embedded region; it is not a full-window frameset with independently divided page regions.
  • Use server-side includes when the goal is to reuse page regions such as a shared header or navigation across complete pages. This combines content into pages rather than making each region a separate browser frame.

These alternatives solve different problems: an iframe embeds a separate document, while server-side includes help assemble pages from shared pieces. Choose based on the purpose, rather than translating a frameset layout element for element.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recognizing frames in a legacy site

  • A document containing FRAMESET and FRAME markup describes the window divisions and the documents loaded into them.
  • Links with a target matching a frame’s name navigate that region.
  • BASE TARGET may set the default destination for links, while JavaScript may update multiple frames from one action.
  • NOFRAMES may contain alternate content for browsers unable to display the frameset.

These clues help explain how an older site behaves; they are not a recommendation to build a new one using frames.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

More from the Paint Desk

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.