Bookmark and Share


A simple three-framed page:

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


Definition and Usage

The <frame> tag defines one particular window (frame) within a frameset.

Each frame in a frameset can have different attributes, such as border, scrolling, the ability to resize, etc.

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari
The <frame> tag is supported in all major browsers.

Differences Between HTML and XHTML

In HTML the <frame> tag has no end tag.

In XHTML the <frame> tag must be properly closed.

Tips and Notes

Note: If you want to validate a page containing frames, be sure the doctype is set to "Frameset DTD". Read more about doctypes.

Important: You cannot use the body element together with the frameset element. However, if you add a <noframes> tag containing some text for browsers that do not support frames, you will have to enclose the text in a body element.

Optional Attributes

DTD indicates in which HTML 4.01/XHTML 1.0 DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.

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

Standard Attributes

The <frame> tag supports the following standard attributes:
Attribute Value Description DTD
class classname Specifies a classname for an element F
id id Specifies a unique id for an element F
style style_definition Specifies an inline style for an element F
title text Specifies extra information about an element F

Event Attributes

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

Our Followers

Speak to us !

Creative Commons License [Valid RSS] [Valid Atom 1.0] Trust Seal