HTML Tags – Frame Tag

What is HTML <frame> tag ?

HTML <frame> tag defines the frame window.

HTML <frame> tag is used with the <frameset> element and <frameset> holds one or more <frame> elements.

HTML <frame> tag remove in HTML5 specification.

How HTML <frame> tag works ?

HTML <frameset> tag splits the browser window in several individual frames that can contain a separate HTML web document.

HTML <frameset> tag divides a webpage into multiple sections or frames, and each frame can contain different web pages.

And HTML <frame> is specific window or a frame, where we can load another web page.

We can use the “src” attribute to define the address of this web page.

A single web page can have several such frames.

Why HTML <frame> tag is used ?

HTML <frame> tag used improve appearance and usability of a site.

Note: HTML <frame> tag as it is not supported in HTML5, instead we can use <iframe> or <div> with CSS to achieve similar effects in HTML.

HTML beginners tutorial !!!

Click to Learn More about – HTML Tutorial for beginners

Syntax :

<frameset cols="50%,50%">
    <frame src="frame1.html" />
    <frame src="frame2.html" />


<body style="background-color:green;">
  <h2 align="center">Frame 1</h2>


<body style="background-color:yellow;">
  <h2 align="center">Frame 2</h2>


<!DOCTYPE html>
    <title>Title of the document</title>
  <frameset cols="50%,50%">
    <frame src="frame1.html">
    <frame src="frame2.html">

Output :

<frame> Tag Attributes

HTML <frame> tag support following specific attributes. All following attributes has been removed in HTML5.

Specify whether display a border or not.
2longdescurlSpecify URL link to another page having a long description of the frame contents.
3marginheightpixel_sizeSpecify the top and bottom margins of frame.
4marginwidthpixel_sizeSpecify the left and right margins of frame.
5namenameSpecify the frame name.
6noresizenoresizeSpecify that prevents to resize frame.
Specify weather scrollbars should be display or not.
8srcurlSpecify web document URL to show in a frame.

Global Attributes

HTML <frame> tag support following global attributes.

1idunique_nameDeclared unique id for an element.
2classclass_nameDeclared one or more classnames for an element.
3stylestylesCSS inline styles specify an element.
4titletitleSpecify extra details of element contain, this will display as a “tooltip” for an elements.

Event Attributes

HTML <frame> tag does not support any event attributes.

Browser Compatibility

6Internet ExplorerYes