<FRAME>NN 2   IE 3   HTML 4
<FRAME>End Tag: Forbidden
 

The FRAME element defines properties of an individual window space that is some fractional portion of the entire browser window. A FRAME element must be defined within the context of a FRAMESET element. It is the FRAMESET that defines the row and column arrangement of a related group of frames.

A browser treats a frame as a separate browser window within the browser application's window. As such, each frame window can load its own content, independent of other frames. Although no attributes of the FRAME element are required, assigning a value to the NAME attribute is highly recommended if you have forms or links whose returned or destination document is to be displayed in a different frame. Scripting among multiple frames also benefits greatly from names assigned to frames because it makes references to those frames (and their contents) more easily understandable to someone reading the script code.

 
Example
<FRAMESET COLS="150,*">
    <FRAME NAME="navbar" SRC="nav.html">
    <FRAME NAME="main" SRC="page1.html">
</FRAMESET>
 
Object Model Reference
NN [window.]frameName
[window.]frames[i]
IE [window.]frameName
[window.]frames[i]
[window.]document.all.frameID
BORDERCOLORNN 3   IE 4   HTML n/a
BORDERCOLOR="colorTripletOrName"Optional
 

If your frameset displays borders (as set with the BORDER attribute of the FRAMESET element), but you want a subset of the frames in the frameset to be rendered with a border color different from the rest, you can assign a color to the BORDERCOLOR attribute of an individual FRAME element. Mixing border colors in a frameset exposes your HTML to the risk of different rendering techniques of each browser and operating system. Not only do the precise pixel composition of borders vary, but each browser and operating system may resolve conflicts between different colored borders differently. If you assign a color to only some frames of a frameset, be sure to test the look on as many browser versions and operating systems as possible to evaluate the visual effect of your color choices.

 
Example
<FRAME NAME="navbar" SRC="nav.html" BORDERCOLOR="salmon">
 
Value
A hexadecimal triplet or plain-language color name.
 
Default None.
 
Object Model Reference
IE [window.]document.all.frameID.borderColor
DATAFLDNN n/a   IE 4   HTML n/a
DATAFLD="columnName"Optional
 

Used with IE 4 data binding to associate a remote data source column name in lieu of an SRC attribute for a FRAME element. The data source column must contain a valid URI (relative or absolute). A DATASRC attribute must also be set for the element.

 
Example
<FRAME DATASRC="#DBSRC3" DATAFLD="newsURL">
 
Value
Case-sensitive identifier.
 
Default None.
 
Object Model Reference
IE [window.]document.all.frameID.dataFld
DATASRCNN n/a   IE 4   HTML n/a
DATASRC="dataSourceName"Optional
 

Used with IE 4 data binding to specify the name of the remote ODBC data source (such as an Oracle or SQL Server database) to be associated with the element. Content from the data source is specified via the DATAFLD attribute.

 
Example
<FRAME DATASRC="#DBSRC3" DATAFLD="newsURL">
 
Value
Case-sensitive identifier.
 
Default None.
 
Object Model Reference
IE [window.]document.all.frameID.dataSrc
FRAMEBORDERNN 3   IE 3   HTML 4
FRAMEBORDER="borderSwitch"Optional
 

Controls whether an individual frame within a frameset displays a border. The setting is supposed to override the FRAMEBORDER attribute setting of the containing FRAMESET element. Controlling individual frame borders appears to be a problem for most browsers in most operating system versions. Turning off the border of one frame may have no effect if all adjacent frames have their borders on. Feel free to experiment with the effects of turning some borders on and some borders off, but be sure to test the final effect on all browsers and operating systems used by your audience. Rely more comfortably on the FRAMEBORDER attribute of the entire FRAMESET.

 
Example
<FRAME NAME="navbar" SRC="nav.html" FRAMEBORDER=no>
 
Value
On-off values for this attribute vary with the source. HTML 4.0 specifies the values of 1 (on) and 0 (off). Navigator uses yes and no. Internet Explorer 4 accepts both sets of values. For cross-browser compatibility, use the yes/no pairing.
 
Default yes
 
Object Model Reference
IE [window.]document.all.frameID.frameBorder
HEIGHT, WIDTHNN n/a   IE 4   HTML n/a
HEIGHT="length"
WIDTH="length"
Optional
 

Microsoft HTML documentation for IE 4 says that the HEIGHT and WIDTH attributes control the size of a frame. In practice in IE 4, these attributes have no direct control over the appearance of the frames within a frameset. Instead, the COLS and ROWS attributes of the containing FRAMESET govern the initial geometry of a frame. Because the corresponding object properties for a frame are documented, but not part of the IE 4 document object model, the HEIGHT and WIDTH attributes are most likely in the documentation by error. Do not use them.

LONGDESCNN n/a   IE n/a   HTML 4
LONGDESC="URL"Optional
 

Specifies a URL of a document that contains a longer description of the element than what the content of the TITLE attribute reveals. One application of this attribute in future browsers is to retrieve an annotated description of the element for users who cannot read the browser screen.

 
Example
<FRAME LONGDESC="navDesc.html" TITLE="Navigation Bar" SRC="navbar.html">
 
Value
Any valid URI, including complete and relative URLs.
 
Default None.
MARGINHEIGHT, MARGINWIDTHNN n/a   IE 3   HTML 4
MARGINHEIGHT="pixelCount"
MARGINWIDTH="pixelCount"
Optional
 

The number of pixels between the inner edge of a frame and the content rendered inside the frame. The MARGINHEIGHT attribute controls space along the top and (when scrolled) the bottom edges of a frame; the MARGINWIDTH attribute controls space on the left and right edges of a frame. The HTML 4.0 specification leaves default behavior up to browsers.

Without any prompting, Internet Explorer 4 automatically inserts a margin of 14 (Windows) or 8 (Macintosh) pixels inside a frame. But if you attempt to override the default behavior, be aware that setting any one of these two attributes causes the value of the other to go to zero. Therefore, unless you want the content to be absolutely flush with various frame edges, you need to assign values to both attributes. Due to the disparity in default values for each operating system, you cannot assign truly default values to these attributes.

 
Example
<FRAME SRC="navbar.html"  MARGINHEIGHT=20 MARGINWIDTH=14>
 
Value
Any positive integer value or zero.
 
Default 14 (Windows) or 8 (Macintosh).
 
Object Model Reference
IE [window.]document.all.frameID.marginHeight
[window.]document.all.frameID.marginWidth
NAMENN 2   IE 3   HTML 4
NAME="elementIdentifier"Optional
 

When links and forms must load their destination or returned documents into frames other than the one holding the link or form, those elements have TARGET attributes indicating which frame receives the new content. To direct such content to a frame, the frame must have a value assigned to its NAME attribute. That same value is assigned to the TARGET attribute of the A or FORM element. Client-side scripting also uses the frame's name in building references to other frames or content in other frames. It is good practice to assign a unique identifying name to all frames.

 
Example
<FRAME NAME="navbar" SRC="nav.html">
 
Value
Case-sensitive identifier.
 
Default None.
 
Object Model Reference
NN [window.]frameName.name
[window.]frames[i].name
IE [window.]frameName.name
[window.]frames[i].name
[window.]document.all.frameID.name
NORESIZENN 2   IE 3   HTML 4
NORESIZEOptional
 

Frame borders can be resized by the user dragging the border perpendicular to the axis of the border edge. When present, the NORESIZE attribute instructs the browser to prevent the frame's edges from being manually resized by the user. All border edges of the affected FRAME element become locked, meaning that all edges that extend to other frames in the frameset remain locked as well.

 
Example
<FRAME SRC="navbar.html" NORESIZE>
 
Value
The presence of the attribute makes the frame nonresizable.
 
Default Frames are resizable by default.
 
Object Model Reference
IE [window.]document.all.frameID.noResize
SCROLLINGNN 2   IE 3   HTML 4
SCROLLING=auto | no | yesOptional
 

By default, browsers add vertical and/or horizontal scrollbars when the content loaded into a frame exceeds the visible content region of the frame. Scrollbars can affect the layout of some content because they occupy space normally devoted to content (that is, the frame does not expand to accommodate scrollbars). Also, due to differences in default font sizes in browsers and operating system versions, a given collection of text content may display differently in different clients. If you want to prevent scrollbars from appearing in the frame, set the SCROLLING attribute to no; if you want scrollbars to be in the frame at all times, set the attribute to yes. In the latter case, if the content does not require scrolling, the scrollbars are disabled. In some older versions of Navigator, the automatic scrollbars remain visible, even if content not requiring them is subsequently loaded into a frame. In Navigator 4 (and all versions of Internet Explorer), the automatic scrollbars appear only when needed.

Setting the SCROLLING attribute to no should be used only after you have tested on all browsers and platforms that mission-critical content is always visible in the frame. If the frame is set to not scroll and has the NORESIZE attribute set, some users might not be able to see all the content of the frame.

 
Example
<FRAME SRC="navbar.html" SCROLLING=no>
 
Value
Case-insensitive constant values (quoted or not): auto | no | yes.
 
Default auto
 
Object Model Reference
IE [window.]document.all.frameID.scrolling
SRCNN 2   IE 3   HTML 4
SRC="URL"Optional
 

Defines the URL of the content to be loaded into the FRAME element. The URL can be an absolute URL or one relative to the URL of the document containing the frameset specifications. You may also use the javascript: pseudo-URL to have the returned value of a script appear in the frame. For example, if you want a frame to be blank when the frameset loads, you can define a function in the frameset document that returns a blank HTML page. The SRC attribute for each soon-to-be blank frame invokes the function from the vantage point of the child frame:

<HTML>
<SCRIPT LANGUAGE="JavaScript">
function blank() {
    return "<HTML></HTML>"
}
</SCRIPT>
<FRAMESET COLS="50%,50%">
    <FRAME NAME=leftFrame SRC="javascript:parent.blank()">
    <FRAME NAME=rightFrame SRC="javascript:parent.blank()">
</FRAMESET>
</HTML>

Another type of blank page is available from some browsers and versions via the about:blank URL, which draws from an internal blank page. However, Navigator 2 and 3 for the Macintosh display an unwanted message with this URL in a window or frame.

 
Example
<FRAME SRC="navbar.html">
 
Value
A complete or relative URL or a javascript: pseudo-URL.
 
Default None.
 
Object Model Reference
IE [window.]document.all.frameID.src
Hosted by uCoz