frame

FilterElements

HTML: <frame>
XHTML: <frame/>  or  <frame />

Not in HTML5. Defines a single frame within a frameset.

Start/End Tags

This is an empty element. In HTML, the end tag is forbidden. In XHTML, the element must be closed with a trailing slash as just shown. Developers may include a space character before the slash for backward compatibility with older browsers.

Specifications

  • HTML 4.01

frameborder=

Values: 1 | 0
Determines whether there is a 3D separator drawn between the current frame and surrounding frames. A value of 1 turns the border on. A value of 0 turns the border off. The default value is 1 (border on).

longdesc=

Values: URL
Specifies a link to a document containing a long description of the frame’s contents. Although longdesc is included in the HTML 4.01 and XHTML 1.0 Recommendations, no browsers currently support it.

marginheight=

Values: number
Specifies the amount of space (in pixels) between the top and bottom edges of the frame and its contents. The minimum value according to the HTML 4.01 specification is 1 pixel. Setting the value to 0 to place objects flush against the edge of the frame works in some browsers but may yield inconsistent results.

marginwidth=

Values: number
Specifies the amount of space (in pixels) between the left and right edges of the frame and its contents. The minimum value according to the HTML specification is 1 pixel. Setting the value to 0 to place objects flush against the edge of the frame works in some browsers but may yield inconsistent results.

name=

Values: text
Deprecated in XHTML 1.0; use id instead. Assigns a name to the frame. This name may be referenced by targets within links to make the target document load within the named frame.

noresize

Values: None in HTML. noresize="noresize" in XHTML.
Prevents users from resizing the frame. By default, despite specific frame size settings, users can resize a frame by clicking and dragging its borders.

scrolling=

Values: yes | no | auto
Specifies whether scroll bars appear in the frame. A value of yes means scroll bars always appear, a value of no means scroll bars never appear, and a value of auto (the default) means scroll bars appear automatically when the contents do not fit within the frame.

src=

Values: URL
Specifies the location of the initial file or resource to be displayed by the frame.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/HTML4.01/frameset.dtd">

<html>
<head>
<title>Simple Framed Document</title>
</head>

<frameset cols="200,*">
  <frame src="left.html">
  <frame src="right.html">
</frameset>

<noframes>
<body>
<p>Your browser does not support frames.</p>
</body>
</noframes>

</html>

Rendered Example

This is an image of how the framed document may appear in a browser.