HTML framespacing Attribute

The obsolete framespacing attribute was historically used with frameset-based webpages to specify the amount of space between adjacent frames.

Historical Syntax

The framespacing attribute could be added to a <frameset> element with a numeric value representing the requested amount of space between frames:

<frameset cols="30%,70%" framespacing="10">
  <frame src="navigation.html">
  <frame src="content.html">
</frameset>

In this example, the browser was requested to leave space between the two frames. The exact appearance depended on the browser and its handling of frameset borders and spacing.

Historical Elements

The framespacing attribute was associated with the obsolete frameset layout system.

Element Historical Purpose
<frameset> Requested spacing between the frames contained within a frameset.

Historical Use

Older webpages could use the <frameset> element to divide the browser window into separate regions. Each region could contain a different document loaded with a <frame> element.

The framespacing attribute was used by some browsers to control the amount of space separating those frame regions. Authors sometimes combined it with attributes such as frameborder to influence the appearance of the boundaries between frames.

The attribute was not a dependable standard method for page layout. Its visual results could depend on browser-specific frame rendering.

Why It Became Obsolete

The framespacing attribute belonged to the frameset-based layout model, which is itself obsolete. Frameset documents divided a browser window into separate HTML documents, creating problems with navigation, linking, accessibility, printing, and maintaining a consistent document structure.

Modern webpages use ordinary HTML elements to create the document structure and CSS to control the visual layout. This allows the page to remain a single document while providing far more flexible control over columns, rows, spacing, and responsive behavior.

Modern Alternative

There is no direct modern replacement for framespacing because modern webpages should not use framesets for page layout. When separate layout regions need space between them, CSS provides properties designed specifically for that purpose.

For example, CSS Grid can create two columns and the gap property can control the space between them:

<div class="page-layout">
  <nav>Navigation</nav>
  <main>Main Content</main>
</div>

<style>
.page-layout {
  display: grid;
  grid-template-columns: 30% 70%;
  gap: 20px;
}
</style>

CSS Flexbox can also arrange content into separate regions, and its gap property can provide consistent spacing between flex items.

Play in Editor

Learn More About Modern CSS Layout

The CSS tutorials explain how to create modern page layouts and control spacing between layout regions:

  • CSS Grid - Create layouts using rows and columns.
  • CSS Flexbox - Arrange and align content using flexible layout containers.

Legacy Browser Support

The framespacing attribute was a browser-specific feature associated with older frameset implementations rather than a dependable cross-browser HTML layout feature.

Modern webpages should not depend on browsers recognizing framespacing. Frameset-based layouts should be replaced with standard HTML structure and CSS layout techniques.

For additional information about historical browser compatibility, visit Can I Use? . Search for the HTML element or attribute you want to check. Search results can include related HTML features, element attributes, APIs, and other technologies, so select the result that most closely matches the legacy feature you are researching.

Other obsolete attributes historically associated with frames and frameset presentation include:

  • frameborder - Historically used to control whether borders appeared around frames.
  • marginheight - Historically used to control vertical margins inside framed content.
  • marginwidth - Historically used to control horizontal margins inside framed content.
  • noresize - Historically used to prevent a frame from being resized.
  • scrolling - Historically used to control scrollbars for framed content.

Specifications

The framespacing attribute and the frameset-based layout model should not be used in modern HTML. Modern webpages should use standard document structure and CSS for page layout. See the WHATWG HTML Living Standard for information about obsolete and non-conforming HTML features.