Cyber Week

Save big!

All courses under $5 - for a limited time!

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

Browser image
Chrome
All
Browser image
Edge
All
Browser image
Firefox
All
Browser image
IE
All
Browser image
Opera
All
Browser image
Safari
All

Mobile browser support

Browser image
Chrome
All
Browser image
Firefox
All
Browser image
Opera
All
Browser image
Safari
All