You are here:  NetStrider » Tutorials » HTMLRef » Frames » FRAME «
<FRAME> Command

Command Syntax:

<FRAME src="URL" command parameters>

Establishes, defines and loads a frame in a framed HTML document.

The command tag is unpaired since a frame is an object.

See also:  <FRAMESET>, <IFRAME>, <NOFRAMES>

Primary Command Parameters:

src="URL"

Defines the location ( URL )of the HTML code that will be loaded into the frame.


name="frame name"

Defines the name by which the frame will the targeted in hypertext reference links.

Below is a list of reserved names which have special meaning in HTML and cannot be used as frame names with a framed document:

_blank loads the HTML code into a new browser window.
 
_self loads the HTML code over itself in the current window or frame.
 
_parent loads the HTML code over the parent document, if any. _top loads the HTML code at the top level of the current browser window.

Note that all these reserved names begin with the underscore character ( _ ).

Secondary Command Parameters:
bordercolor="color name | color value"

Defines the color to be used to draw the frame border in the Netscape browser.  The value can be expressed either as a named color or a hexadecimal color value.  The parameter can also be used at the frameset level to establish a global frame border color.

frameborder="pixels | yes | no"
frameborder/noframeborder

Defines the dimensions and presence or absence of a border around the frame.

The Netscape browser uses values of yes | no which merely determine whether or not a border will be drawn around the frame.  In the Netscape browser all contiguous frames share a common border. The default condition is on - yes.

It is best to use this parameter at the frameset level.  Otherwise all contiguous frames must have the same value set in order for the parameter to work properly.

The alternate frameborder/noframeborder parameter pair toggle frame borders on and off.  The default is on - frameborder.

The Internet Explorer browser takes a pixel argument for the parameter.  If the pixel value is set to 0 then the border is not drawn.

framespacing="pixels"

Used only in the Internet Explorer browser, this parameter defines the pixel value to be set on the whitespace or standoff surrounding a frame outside its border.  This gives the appearance of a frame within a frame.

marginwidth|marginheight="pixels"

Defines the pixel value to be set on the width and/or height, respectively, of the margins ( whitespace or standoff ) surrounding the contents of a frame.

scrolling="auto | yes | no"

Establishes whether or not the user can scroll the contents of a frame.  A value of auto allows the browser to determine if scroling is necessary in order for the frame to be viewed properly.

noresize

Prevents the user from resizing a frame.  By default, all frames are resizable.  It is unwise to prevent frame resizing unless it is certain that the frame contents will view properly at all screen resolutions without the capability.

Example:
Code very like this defines the frameset for this document: <frameset rows="100,*"> <frameset cols="50%,50%"> <frame src="banner1.html" tppabs="http://www.netstrider.com/tutorials/HTMLRef/frames/banner1.html" name="banner1"> <frame src="banner2.html" tppabs="http://www.netstrider.com/tutorials/HTMLRef/frames/banner2.html" name="banner2"> </frameset> <frameset cols="25%,75%"> <frame src="toc.html" tppabs="http://www.netstrider.com/tutorials/HTMLRef/frames/toc.html" name="toc"> <frame src="javascript:if(confirm('http://www.netstrider.com/tutorials/HTMLRef/frames/intro.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found. \n\nDo you want to open it from the server?'))window.location='http://www.netstrider.com/tutorials/HTMLRef/frames/intro.html'" tppabs="http://www.netstrider.com/tutorials/HTMLRef/frames/intro.html" name="display"> </frameset> </frameset> The innermost nested elements are the <FRAME> elements.  These define the location of the HTML code that will be loaded into and displayed in each of the four independent frames in the example above.

Note that the entire frameset contains three <FRAMESET> command elements.  Two secondary framesets are nested within the primary frameset.  Proper nesting of elements is the key to successful frames coding.

The frameset elements set up the rows and columns for the display of the framed document.  In this example, the primary frameset sets up two rows.  The secondary framesets set up the columns within each row independently of one another.

Return to Section E:H


HTML Reference Guide Table of Contents.
Author: Randy D. Ralph.  In place February 23, 1999.  Copyright © 1999 NetStrider.  Presented as a public service.




Hosted by uCoz