Currently, frames are only supported by Netscape 2 and above, and Microsoft Internet Explorer 3. For some more detailed tag descriptions, see Netscape's Implementation of Frames.
Frames are displayed through a Frame Definition document. The frame definition describes the number and position of the frames and the URL of their contents. You cannot write the contents of the frames within the frame definition - these must always be held in separate documents.
tag is replaced by the
tag. The
tag will be ignored if any tags normally found within the
element are placed before it. The
container holds the
elements which describe the frames that will make up the page. As you will see, the
tag can be nested where necessary.
rows="x1,x2,...|x1%,x2%,...|x1*,x2*,..."
*
) is used to designate rows that are relatively sized.
would fix the height of the top and bottom frames and allocate the remaining space in the window to the middle frame.
would display a large middle frame between two smaller frames.
cols="x1,x2,...|x1%,x2%,...|*"
rows
attribute.
frameborder="yes|no|0"
yes
and no
, while MS Internet Explorer uses the value 0
(zero). Therefore to be sure the frame border is turned off, you must use the attribute twice. This attribute can be used with the
tag to set the borders for a single frame.
border="value"
bordercolor="#hexcolor"
tag to set the border colour for a single frame.
src="URL"
. If no src
attribute is specifed, the frame will remain as blank space.
name="window name"
target
attribute. The name must begin with an alphanumeric character.
scrolling="yes|no|auto"
auto
, which lets the browser decide whether the frame needs scrollbars and display them where necessary.
noresize
noresize
attribute will prevent the user from resizing the frame. By default the user can resize frames by dragging the the frame edge to a new position.
marginwidth="value"
marginheight="value"
marginwidth
, this attribute allows the user to set the frame margin height in pixels. By default, the browser will decide upon an appropriate margin height.
bordercolor="#hexcolor"
tag to set the border colour for a group of frames.
framespacing="value"
MS Internet Explorer only. This attribute allows the user to clear space around the frame; defined in pixels.
frameborder="yes|no|"
This attribute enables you to turn off the border around a frame. Currently Netscape Navigator (version 3 only) uses the values yes
and no
, while MS Internet Explorer uses the value 0
(zero). Therefore to be sure the frame border is turned off, you must use the attribute twice. To completely get rid of a frame outline in MSIE you muist also set the framespacing
attribute to 0 (see first example below). This attribute can be used with the tag to set the borders for a group of frames. Note: frame borders will only be turned off if both adjacent frames (even if they are in different framesets) have their
frameborder
attributes set accordingly.
noframes
tags will not be displayed by a frames-capable browser. This tag is useful for providing a link to pages that do not use frames.
In order to direct data to a different frame, the receiving frame must have been named in the frame definition. In the example below, a link in frame 5 directs the file x_frame6.html is into in a frame called frame3. This is done by including the
If the name in the
There are some special target names, called magic target names. These all begin with an underscore ( target
The target attribute is not found in the frame definition but is used within normal HTML documents to direct data to specific frames. Normally when a user clicks on a link, the new document appears in the same window or frame as the link. The target
attribute is used to direct data to a specific. ie. a different, frame or window. We shall consider the target
attribute in terms of frames and the tag. The
target
attribute can also be used with the base
, area
and form
tags.target
attribute in the tag in the following way:
target
attribute does not exist, the document in the link will be opened as a new window with a name as given in the target
attribute. The names must all begin with an alphanumeric character._
).
target="_self"
target="_parent"
target="_top"
target="_blank"
+------------+-------------------------+------------+ | | | | | | | | | | | | | | | | | | | | | | | | +------------+------------+------------+------------+ | | | | | | | | | | | | | | | | | | +-------------------------+-------------------------+
The Frame Definition
Sizzling HTML Jalfrezi - frames example If You do not have a frame-compatible browser - this example won't work without one.
Click here to return to the Frames page.
The example shows all of the features of frames described above, including targeting windows and the noframes feature for non-frame compatible browsers.