HTML <frame>Tag -Not supported in HTML5


Examples

A simple three-frame page:

<frameset cols="25%,50%,25%">
  <frame src="frame_a.htm.html">
  <frame src="frame_b.htm.html">
  <frame src="frame_c.htm.html">
</frameset>

Try it Yourself »
(More examples at the bottom of the page)

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the <frame> tag.


Tag Definition and Usage Instructions

HTML5 does not support the <frame> tag.

The <frame> tag defines a sub-window (frame) in the <frameset>.

Each <frame> in a <frameset> can have different attributes, such as border, scrolling, noresize, etc.

Note:If you want to validate a page containing frames, make sure<!DOCTYPE>is set to "HTML Frameset DTD" or "XHTML Frameset DTD".


Differences Between HTML 4.01 and HTML5

HTML5 does not support the <frame> tag; HTML 4.01 supports the <frame> tag.


Differences Between HTML and XHTML

In HTML, the <frame> tag has no closing tag. In XHTML, the <frame> tag must be properly closed.


Optional Attributes

Attribute Value Description
frameborder 0
1
Not supported in HTML5.Specifies whether or not to display the border around the frame.
longdesc URL Not supported in HTML5.Specifies a page that contains a long description of the frame content.
marginheight pixels Not supported in HTML5.Specifies the top and bottom margins of the frame.
marginwidth pixels Not supported in HTML5.Specifies the left and right margins of the frame.
name name Not supported in HTML5.Specifies the name of the frame.
noresize noresize Not supported in HTML5.Specifies that the frame cannot be resized.
scrolling yes
no
auto
Not supported in HTML5.Specifies whether or not to display scrollbars in the frame.
src URL Not supported in HTML5.Specifies the URL of the document to be displayed in the frame.


Standard Attributes

In HTML 4.01, the <frame> tag supports the following standard attributes:

Attribute Value Description
class classname Specifies the class name of the element
id id Specifies a unique id for the element
style style_definition Specifies an inline style for the element
title text Specifies extra information about the element

For a full description, please visitStandard Attributes。


Event Attributes

According to W3C standards, in HTML 4.01, the <frame> tag does not support any event attributes.

However, all browsers support the onload event.

For a full description, please visitEvent Attributes。


Examples

Try it Yourself - Examples

Horizontal frames
This example demonstrates how to create a horizontal frame using three different documents.

Mixed frame structure
This example demonstrates how to create a frame structure with three documents, and mix them in rows and columns.

Frame structure with the noresize="noresize" attribute
This example demonstrates the noresize attribute. In this example, the frames cannot be resized. If you drag the mouse on the border between frames, you will see that the border cannot be moved.

Other Extensions