<frame>


HTML <frame> Tags - HTML5 Not supported

##Instance

<!DOCTYPE html>
<html>

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

</html>

Run instance»Click the "Run instance" button to view the online instance


Browser support


##All major browsers support the <frame> tag.

Tag definition and usage instructions

HTML5 does not support the <frame> tag.

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

Each <frame> in<frameset> can set different properties, such as border, scrolling, noresize, etc.

Note:

If you wish to validate pages 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 does not have a closing tag. In XHTML, the <frame> tag must be closed properly.

Optional attributes

Attributesframeborder 1HTML5 is not supported. longdescURLSpecifies a page containing a long description about the frame's contents. marginheightpixelsnamenoresizeHTML5 Not supported. yes NoURL
ValueDescription
0
Specifies whether to display the border around the frame.
##HTML5 Not supported.
pixels##HTML5 Not supported. Specifies the upper and lower margins of the frame. marginwidth
HTML5 Not supported. Specifies the left and right margins of the frame. name
HTML5 Not supported. Specifies the name of the framework. noresize
Specifies that the frame cannot be resized. scrolling
auto
HTML5 is not supported.
Specifies whether to display scroll bars in the frame.
src
HTML5 Not supported. Specifies the URL of the document displayed in the frame.

Standard attributes

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

##AttributesValueDescriptionclassSpecifies the class name of the elementidSpecifies the unique id of the elementstyleSpecifies the inline style of the elementtitleSpecifies additional information for the element
classname
id
style_definition
text
For a complete description, visit the standard properties.


Event attributes

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

However, all browsers support the onload event.

For a complete description, visit the event properties.


ExamplesTry it - Example

Horizontal Frame

This example demonstrates: how to use three different documents to make a horizontal frame.

Instance

<!DOCTYPE html>
<html>

<frameset rows="25%,*,25%">
  <frame src="frame_a.htm">
  <frame src="frame_b.htm">
  <frame src="frame_c.htm">
</frameset>

</html>

Run instance»Click the "Run instance" button to view the online instance

Mixed Structure Frame

This example demonstrates how to create a frame structure containing three documents and mix them into rows and columns.

Instance

<!DOCTYPE html>
<html>

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

</html>

Run instance»Click the "Run instance" button to view the online instance

Frame structure containing noresize="noresize" attribute

This example demonstrates the noresize attribute. In this case, the frame is not resizable. Drag your mouse on the border between frames and you will find that the border cannot be moved.

Instance

<!DOCTYPE html>
<html>

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

</html>

Run instance»Click the "Run instance" button to view the online instance