<frame> (Window Region)
This element defines a nameable window region, known as a frame, that can independently display its own content.
frameborder="0 | 1"
id="unique alphanumeric identifier"
longdesc="url of description"
scrolling="auto | no | yes"
src="url" of frame contents
Attributes Defined by Internet Explorer
allowtransparency="no | yes" (5.5)
application="no | yes" (5)
bordercolor="color name | #RRGGBB" (4)
datafld="name of column supplying bound data" (4)
datasrc="id of data source object supplying data" (4)
frameborder="no | yes | 0 | 1" (4)
hidefocus="true | false" (5.5)
lang="language code" (4)
unselectable="on | off" (5.5)
Events Defined by Internet Explorer
onactivate, onafterupdate, onbeforedeactivate, onbeforeupdate, onblur, oncontrolselect, ondeactivate, onerrorupdate, onfocus, onload, onmove, onmoveend, onmovestart, onresize, onresizeend, onresizestart
Element Specific Attributes
- This Internet Explorerspecific attribute determines whether the <frame> is transparent or opaque. The default value is false, which means it is opaque.
- This attribute sets the color of the frame's border using either a named color or a color specified in the hexadecimal #RRGGBB format.
- This Internet Explorer attribute specifies the column name from the data source object that supplies the bound data.
- This Internet Explorer attribute indicates the id of the data source object that supplies the data that is bound to this element.
- This attribute determines whether the frame is surrounded by an outlined three-dimensional border. The HTML specification prefers the use of 1 for the frame border on and 0 for off; most browsers also acknowledge the use of no and yes.
- This attribute specifies a URL of a document that contains a long description of the frame's content. This attribute should be used in conjunction with the <title> element.
- This attribute sets the height in pixels between the frame's contents and its top and bottom borders.
- This attribute sets the width in pixels between the frame's contents and its left and right borders.
- This attribute assigns the frame a name so that it can be the target destination of hyperlinks as well as being a possible candidate for manipulation via a script.
- This attribute overrides the default ability to resize frames and gives the frame a fixed size.
- This attribute determines if the frame has scroll bars. A yes value forces scroll bars, a no value prohibits them, and an auto value lets the browser decide. When not specified, the default value of auto is used. Authors are recommended to leave the value as auto. If you turn off scrolling and the contents end up being too large for the frame (due to rendering differences, window size, and so forth), the user will not be able to scroll to see the rest of the contents. If you turn scrolling on and the contents all fit in the frame, the scroll bars will needlessly consume screen space. With the auto value, scroll bars appear only when needed.
- This attribute sets the value indicating whether the source file of a frame has security restrictions applied. The only allowed value is restricted.
- This attribute contains the URL of the contents to be displayed in the frame. If absent, nothing will be loaded in the frame.
<frame src="controls.htm" name="controls"
<frame src="controls.htm" name="controls"
noresize scrolling="no" />
<frame src="content.htm" />
HTML 4, 4.01, XHTML 1.0 (frameset DTD only)
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 2, 3, 4, 4.5-4.8, 6, 7
XHTML 1.0 requires a trailing slash for this element: <frame />.
A frame must be declared as part of a frame set by using the <frameset> tag, which specifies the frame's relationship to other frames on a page. A frame set occurs in a special HTML document, in which the frameset element replaces the body element.
Another form of frames called independent frames, or floating frames, also is supported. Floating frames can be directly embedded in a document without belonging to a frame set. These are defined with the iframe element.
Many browsers do not support frames and require the use of the <noframes< tag.
Frames introduce potential navigation difficulties; their use should be limited to instances in which they can be shown to help navigation rather than hinder it. See Chapter 8 for more details.