Code has been added to clipboard!

HTML Frames

Reading time 2 min
Published Mar 19, 2019
Updated Sep 30, 2019

HTML Frames: Main Tips

  • The HTML <frame> tag defined one particular frame within a web page or a <frameset> element.
  • Applying HTML frames element is not recommended: use <iframe> as an alternative.

How frame Was Used

The <frame> tag declared an area for displaying another HTML file. Not supported in HTML5 anymore.

Example
<frameset cols="70%, 30%">
  <frame src="main.html">
  <frame src="copyright.html">
</frameset>

frameborder

Sets the visibility of frame border. 0 means hide, 1 means show.

Example
<frameset cols="30%, 20%, 50%">
  <frame src="demo.html" frameborder="0">
  <frame src="main.html" frameborder="0">
  <frame src="links.html" frameborder="1">
</frameset>

longdesc

Specifies the link for a long description of the content inside a frame.

Example
<frameset cols="60%, 40%">
  <frame src="demo.html">
  <frame src="main.html" longdesc="mainData.txt">
</frameset>

marginheight

Sets margin values for top and bottom of the frame (different from other HTML frames).

Example
<frameset cols="20%, 80%">
  <frame src="demo.html" marginheight="20">
  <frame src="main.html" marginheight="40">
</frameset>

marginwidth

Sets margin values for left and right of the frame, different from other HTML frames.

Example
<frameset cols="30%, 70%">
  <frame src="contact.html" marginwidth="60">
  <frame src="main.html" marginwidth="10">
</frameset>

name

Sets the name for elements of HTML frames.

Example
<frameset cols="30%, 30%, 40%">
  <frame src="preview.html" name="preview">
  <frame src="demo.html" name="demo">
  <frame src="main.html" name="main">
</frameset>

noresize

Defines that a particular frame cannot be resized.

Example
<frameset cols="50%, 50%">
  <frame src="host.html">
  <frame src="learn.html" noresize="noresize">
</frameset>

scrolling

Defines if the content within a frame can be scrolled or not.

Example
<frameset cols="40%, 60%">
  <frame src="frame.html">
  <frame src="learn.html" scrolling="auto">
</frameset>

src

Specifies the link to a document served as the content of a frame.

Example
<frameset>
  <frame src="http://bitdegree.org/frame.html">
  <frame src="http://bitdegree.org/main.html">
</frameset>

Browser support

Chrome
All
Edge
All
Firefox
All
IE
All
Opera
All
Safari
All

Mobile browser support

Chrome
All
Firefox
All
Opera
All
Safari
All
Basics
Introduction
Syntax
Editors
Basic Examples
Head Section
<!DOCTYPE>
Tags and Elements
Semantic Elements
Tags Reference
Attributes
Comments
Block and Inline Elements
Forms
Form Elements
Input
Responsive Web Design
Inline Scripts
Uniform Resource Locator
Redirect
XHTML
Geolocation
Drag and Drop
Local Storage
Web Workers
Server-Sent Events
Character Encoding
Text Formatting
Quotation and Citation Elements
Headings
Paragraphs
Links
Tables
Lists
Symbols
Space
Tab
Styles
Computer Code
Layout
Classes
Colors
Images
iframes
Audio Player
Video Player
YouTube Videos
Multimedia
Canvas
SVG
<!-- -->
<a>
<abbr>
<acronym> DEPRECATED
<address>
<applet> DEPRECATED
<article>
<aside>
<audio>
<b>
<base>
<basefont> DEPRECATED
<bdi>
<bdo>
<big> DEPRECATED
<blink> DEPRECATED
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center> DEPRECATED
<cite>
<code>
<col>
<colgroup>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir> DEPRECATED
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font> DEPRECATED
<footer>
<form>
<frame> DEPRECATED
<frameset> DEPRECATED
<h1> – <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<keygen> DEPRECATED
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<menu>
<menuitem> DEPRECATED
<meta>
<meter>
<nav>
<noframes> DEPRECATED
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike> DEPRECATED
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt> DEPRECATED
<u>
<ul>
<var>
<video>
<wbr>