W3CWD-frames-970331


Implementing HTML Frames

W3C Working Draft 31-Mar-97

This version:
http://www.w3.org/pub/WWW/TR/WD-frames-970331
Latest version:
http://www.w3.org/pub/WWW/TR/WD-frames
Editor:
Arnaud Le Hors <lehors@w3.org>
Author:
Murray Maloney <maloney@sq.com>

Status of This Document

This draft is work under review by the W3C HTML Working Group, for potential incorporation in an upcoming version of the HTML specification, code named Cougar. Please remember this is subject to change at any time, and may be updated, replaced or obsoleted by other documents. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress".

A list of current W3C Working Drafts can be found at http://www.w3.org/pub/WWW/TR. This is work in progress and does not imply endorsement by, or the consensus of, either W3C or members of the HTML working group. Further information about Cougar is available at http://www.w3.org/pub/WWW/MarkUp/Cougar/.

Please send detailed comments to www-html-editor@w3.org. We cannot garantee a personal response, but summaries will be maintained off the Cougar page. Public discussion on HTML features takes place on www-html@w3.org. To subscribe send a message to www-html-request@w3.org with subscribe in the subject.

Abstract

This document describes frame documents, the HTML syntax for frames, frame implementation notes, and includes a new proposal for extensions.

Frames are a way to describe a presentation by dividing the two-dimensional space of a display window (the browser, or user agent) into rectangular areas. Each frame has a name and can be named as the display area to be used for the other anchor of an A link (via the TARGET attribute of the A element type, which names the frame the object located by the src atribute should be presented in). In other words, frames let you define a set of regions on a screen, give them some initial content and then let you continue to use them for objects linked to.

This document also describes a proposal for a new element called IFRAME designed as a means to create compound documents by placing frames in HTML documents. Called "inline frames," this design technique allows authors to insert HTML documents the same way they insert images using the IMG element. This means authors can use the ALIGN attribute just as they do with IMG to align the frame with the surrounding text. An alternative based on OBJECT is also discussed.

Frame Documents

Frames divide a browser window into two or more document windows, each displaying a different document, or a different part of the same document. Frames in an HTML document can cause a web page to appear to be divided into multiple, scrollable regions. For each frame, you can assign a name, a source document locator, dimensions, border alignment and decorations, scroll and resize behaviors, loading and unloading behavior, file and topic maps, and style sheets.

These properties make possible:

Frame Document Structure

Frames in HTML documents are created and controlled through the structure of three element types: FRAMESET, FRAME and NOFRAMES.

A web page containing frames is created by a main or "framing" document. This document defines the frame regions on the user agent's page or window, and addresses the documents or objects that initially appear in the frames. Hypertext anchors within any frame can also target specific frames to place the contents of addressable documents and objects.

The structure of a frame-enabling HTML document type is similar to usual HTML structure. The key difference in an HTML document type is that the BODY container element is basically replaced by a FRAMESET container element. The initial FRAMESET element describes the frames that make up the page, and the FRAME elements specify the sub-documents that appear initially in each.

A FRAMESET may only contain nested FRAMESET and FRAME elements. When a FRAMESET element is nested within another FRAMESET element, it acts as a subframe. A BODY element can follow the FRAMESET to provide an alternative document for user agents that do not support frames. And a BODY element can contain NOFRAMES elements whose contents are not to be rendered by user agents which support frames.

A frame document contains a set of frames, each of which likely uses the BODY element. Elements that might normally be placed in the BODY element should not appear before the first FRAMESET element, or the FRAMESET will be ignored. The FRAMESET tag has a matching end tag.

Frame Document Syntax

Frame syntax is similar in scope and complexity to that used by tables, and has been designed to be quickly processed by Internet client layout engines.

<HTML>
<HEAD> 
</HEAD> 

<FRAMESET rows="33%,33%,33%">
  <FRAMESET cols="50%,50%">
      <FRAME name="frame1">
      <FRAME name="frame2">
  </FRAMESET>
  <FRAME name="frame3">
  <FRAME name="frame4">
</FRAMESET>
<BODY>
...contents to display in non-frame-capable user agent...
</BODY>

</HTML>

Basic Frame Concepts

Try to remember the following basic frameset concepts:

The FRAMESET Element

A frameset divides the browser window into rectangular regions. Each such region can be:

For example, a frame set can contain a frame, plus another frame set containing two frames, resulting in three frames in all.

An HTML document that contains frames basically replaces the BODY element with the FRAMESET element.

The rows and cols attributes

The attributes of the FRAMESET element are COLS (columns) and ROWS. They determine how many frames the frame set is divided into. These attributes may be blank, or may consist of a list of one or more values separated by commas or spaces. Each such value determines the width (for columns) and height (for rows) of the regions; the number of width and height values supplied determines how many rows and columns, respectively, are created. The default for each is one. For example if you have:

<FRAMESET cols="20%,30%,50%">

in which there is no ROWS value, the frame set is divided vertically into three regions: the first region's width is 20% of the current frame set (or browser window if this frame set is at the top level), the second region's width is 30%, and the third region's width is 50%. When there is only one frame set in the document, these widths apply to the entire browser window. Similarly, when there is a ROWS value but no COLS value, the frame set is divided horizontally into regions. When values are supplied for both attributes, the frame set is divided into a grid of rows and columns.

The ROWS and COLS attributes take comma-separateds lists of values. These values can be absolute pixel values, percentage values between 1 and 100, or relative scaling values. The number of rows and columns is implicit in the number of values in the respective list. Since the total height of all the rows must equal the height of the window, row heights might be normalized to achieve this. If the rows (or cols) attribute values are unspecified, then the number of rows (or columns) is assumed to be one, and it may be arbitrarily sized to fit.

Syntax of Value List

value
A simple numeric value is assumed to be a fixed size in pixels. The result of this value varies with the size of a viewer's window. Fixed pixel values are usually used with one or more of the relative size values described below. You might use a fixed value if you want a graphic, such as an image map, to fill an entire frame and you want to ensure that the frame is big enough to display the entire image. User agents can be expected to override a specified pixel value to ensure that the total proportions of a frame are 100% of the width and height of a user's window.
value%
This is a simple percentage value between 1 and 100. If the total is greater than 100, all percentages are scaled down. If the total is less than 100, and relative-sized frames exist, extra space is given to them. If there are no relative-sized frames, all percentages are scaled up to match a total of 100%. For example, suppose you assign the ROWS attribute a value of "50%,50%,50%". Each entry is 50%, which is one third of the sum of all the entries (150%), so the browser assigns the frame sizes proportionately, giving each frame one third of the browser height.
value*
The value on this field is optional. A single '*' character is a "relative-sized" frame and is interpreted as a request to give the frame all remaining space. If multiple relative-sized frames are specified, the remaining space is divided evenly among them. If there is a value in front of the '*', that frame gets that much more relative space. "2*,*" would give 2/3 of the space to the first frame, and 1/3 to the second.

Example: Setting Frame width and height

There are three ways to specify the width or height of a frame:

Example for 3 rows, the first and the last being smaller than the center row:

<FRAMESET rows="20%,60%,20%">

Example for 3 rows, the first and the last being fixed height, with the remaining space assigned to the middle row:

<FRAMESET rows="100,*,100">

A `relative size' is specified with an asterisk, e.g., `1*', `2*', `3*' (`1*' can also be written simply as `*'). This is interpreted as follows: after all widths (or heights) specified as percentages or absolute amounts have been allocated to the corresponding frames, the remaining space is allocated to frames whose widths (or heights) have been specified as a relative size. The amount of space allocated to a frame is proportional to the number in front of the asterisk. For example:

<FRAMESET rows="30%,400,*,2*">
	<FRAME ... >
	<FRAME ... >
	<FRAME ... >
	<FRAME ... >
</FRAMESET>

Suppose the browser window is currently 1000 pixels high. The first frame gets 30% of the total height, that is, 300 pixels; the second frame gets 400 pixels, since an absolute amount was specified. This leaves 300 pixels to be divided between the other two frames. The fourth frame's height is specified as `2*', so it is twice as high as the third frame, whose height is only `*' (1*). Therefore the third frame is 100 pixels high and the fourth is 200 pixels high.

The FRAME Element

The FRAME element defines a single frame in a frameset. It has 7 possible attributes: SRC, NAME, FRAMEBORDER, MARGINWIDTH, MARGINHEIGHT, SCROLLING, and NORESIZE. The FRAME tag is not a container so it has no matching end tag.

The attributes of the FRAME element type are as follows:

src="address"
Specifies the address of the document to be displayed in the frame. When omitted the frame is displayed as a blank space.
name="window_name"
The NAME attribute is used to assign a name to a frame so it can be targeted by links in other documents (These are usually from other frames in the same document.) The NAME attribute is optional; by default all windows are unnamed. Names must begin with an alphabetic character. Named frames can have their window contents targeted with the TARGET attribute.
frameborder="1|0"
FRAMEBORDER is a boolean which triggers the display of frame separators around the frame. When set to "1" a separator is drawn on every side next to another frame. When set to "0" the decision to draw separators is left to surrounding frames. Indeed in this case separators might still be drawn because FRAMEBORDER is set "1" on adjacent frames. Default is "1".
marginwidth="value"
The MARGINWIDTH attribute is used when the document author wants some control of the margins for this frame. If specified, the value for MARGINWIDTH is in pixels. Margins can not be less than one; this insures that frame objects won't touch frame edges, and can't be specified in a way that leaves no space for the document contents. The MARGINWIDTH attribute is optional; by default, all frames default to letting the browser decide on an appropriate margin width.
marginheight="value"
The MARGINHEIGHT attribute is just like MARGINWIDTH above, except it controls the upper and lower margins instead of the left and right margins.
noresize
The NORESIZE attribute doesn't require a value. It can simply be used as a flag to indicates that the frame is not resizable by the user. Users typically resize frames by dragging a frame edge to a new position. Note that if any frame adjacent to an edge is not resizable, that entire edge is restricted from moving. This affects the resizability of other frames. The NORESIZE attribute is optional; by default all frames are resizable.
scrolling="yes|no|auto"
The SCROLLING attribute indicates whether the frame should have scrollbars or not. "yes" results in scrollbars always being visible on that frame. "no" results in scrollbars never being visible. "auto" instructs the browser to decide whether scrollbars are needed, and to place them where necessary. That is, with "auto", the frame has scrollbars only if the document is larger than the current size of the frame. The SCROLLING attribute is optional; the default value is "auto."

Example

This small document causes three frames to be displayed. The first (outer) FRAMESET element divides the browser window into two horizontal regions. The upper region contains a single frame displaying the document http://www.zenith.com/, and the lower region displays the frames defined in the second (inner) FRAMESET element. This FRAMESET divides the lower part of the window into two vertical frames, displaying the documents http://www.sinister.org/ and http://www.dexter.org/.

<HTML>
<FRAMESET rows="40%,60%">
	<FRAME src="http://www.zenith.com/">
	<FRAMESET cols="50%,50%">
		<FRAME src="http://www.sinister.org/">
		<FRAME src="http://www.dexter.org/">
	</FRAMESET>
</FRAMESET>
</HTML>

The onLoad and onUnload attributes

The ONLOAD and ONUNLOAD attributes on FRAMESET are bound to Intrinsic Events. They allow authors to provide scriptlets to be executed when these events occured giving them more control over the user agent behavior. This however requires that the user agent supports scripting, see HTML Scripts for further details.

Naming and Targeting Frames

This feature gives a document author or designer a degree of control over which frame a document or object will appear in when a user clicks on an anchor or othewise traverses a link in a frame document.

This technique is useful as a standalone feature for a document space that is best viewed with multiple top-level windows (e.g., a list of subjects window, and a window displaying the current subject), but it is most useful in conjunction with frames.

How It Works

Previously when a user clicked on an anchor, the inbound document either appeared in the window the user had clicked in, or alternately (and under the user's control) appeared in a completely new window. Targeting windows for delivery allows the document writer to assign names to specific windows, and target certain documents to always appear in the window bearing the matching name.

A name is assigned to a window in one of three ways:

How the HTML looks

Targeting a frame with HTML is accomplished by means of the TARGET attribute. This attribute can be added to a variety of HTML elements to target a specific frame for links reresented by that element. The attribute takes the following form:

target="window_name"

By default, any anchor in a frame will load a document into that same frame.

NAME is an attribute of the FRAME element. By naming a frame, its contents can be changed with the use of a target attribute in your anchor elements, or in the BASE element of a document referred to in an anchor. By referring to a particular frame with the TARGET element, you control which frame will display the document.

The basic rules are as follows:

Note:User agents may provide a way to override the TARGET attribute.

TARGET usage on an A or LINK element

The anchor tag normally specifies a document to be loaded when the link is traversed; adding the TARGET attribute to these elements forces the document to be loaded into the targeted window. The A and LINK anchor elements can specify that a linked document should be displayed in a specifically named frame. Therefore any frame that the page designer chooses to be a delivery target must be given a name. The name of the frame is the value of the NAME attribute of the corresponding FRAME element. The value of the TARGET attribute of the A or LINK anchor element must be the name of the desired frame.

Here is an example of targeting specific frames using an anchor element.

<FRAMESET rows="45%,10%,45%">
	<FRAME name="upper">
	<FRAME name="middle" src="sources.htm">
	<FRAME name="lower">
</FRAMESET>

<!-- In the document "sources.htm" -->
<UL>
<LI><A target="upper" href="http://www.sgmlopen.org/">
       SGML Open Home Page</A></LI>
<LI><A target="lower" href="http://www.w3.org/">
       W3 Consortium Home Page</A></LI>
</UL>

Clicking on the first anchor will cause the document http://www.sgmlopen.org/ to be displayed in the frame named "upper"; clicking on the second anchor will cause the document http://www.w3.org/ to be displayed in the frame named "lower".

Attaching the TARGET attribute to the LINK element is not widely supported, except by SoftQuad Panorama PRO 2.0.

TARGET usage on a BASE element

This option causes all (or most) of the links in a document to be targeted to the same window. In this case the TARGET attribute establishes a default window_name that all links in this document are targeted to. This default is of course overridden by specific instances of the TARGET attribute in individual anchor elements. Example:

<BASE target="window_name">

TARGET usage on an AREA element

The IETF Internet-Draft of Client-Side Image Maps defines an area element type. It describes a shaped area in a client-side image map, and represents a link to traverse when the user clicks on it. Adding the TARGET attribute to AREA forces the linked document to load in the targeted window. Example:

<AREA SHAPE="shape" COORDS="x,y,..." HREF="url" target="window_name">

TARGET usage on a FORM element

The FORM element normally displays the results of a form submission in the same window the form was submitted from. By adding a TARGET attribute to FORM, the result of the form submission is loaded into the targeted window. Example:

<FORM ACTION="url" target="window_name">

Allowed TARGET names

The window name specified by a TARGET attribute must begin with an alphabetic character or an underscore character in case of a special name listed below. All other window names are ignored.

The recognized special target names are:

_blank
The document will be opened in a new window. This target causes the link to always load in a new blank window. This window is not named.
_self
The document will be opened in the same frame that you clicked in. This causes a linked document to always load into the same frame as the anchor. This can be used to override a globally assigned BASE target.
_parent
This target makes the linked document load into the immediate FRAMESET parent of this document. This defaults to acting like "_self" if the document has no parent.
_top
The document will be opened in the full browser window. If the window has been divided up into frames, it will become a single pane again. This defaults to acting like "_self" if the document is already at the top. It is useful for breaking out of an arbitrarily deep FRAME nesting.

Alternate document for non-frame browsers

Content providers can create an alternative content viewable by non-frame-capable clients and clients set not to use frames. Since some browsers do not support frames, a document that uses frames should always supply an alternate document that these browsers can read. This is achieved by having a BODY element following the outermost FRAMSET element. This BODY element and its content is ignored by frame-capable web clients (unless they are set not to perform a frame based display).

In addition frame-capable browsers ignore all tags and data contain in a NOFRAMES element. Thanks to this element you can include in a document some data which is only displayed by non-frame browsers. Typically this is data that is otherwise displayed in another frame.

Examples

This example shows the HTML source to achieve the layout below using frames.

+----------------------------------------------------------+
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |-----------------------------+
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
+----------------------------|                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |-----------------------------+
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
|                            |                             |
+----------------------------------------------------------+
<FRAMESET cols="50%,50%">
    <FRAMESET rows="50%,50%">
        <FRAME src="cell.html"> 
        <FRAME src="cell.html"> 
    </FRAMESET>
    <FRAMESET>
        <FRAME src="cell.html"> 
        <FRAME src="cell.html"> 
        <FRAME src="cell.html"> 
    </FRAMESET>
</FRAMESET>

<BODY>
<H1>Frame Alert!</H1>
<P>
This document is designed to be viewed using the
frames feature. If you see this message, you are 
using a non-frame-capable web client. 
</P>
</BODY>

The main layout in two columns is obtained by nesting two framesets inside the topmost frameset. The sub framesets then respectively contain two and three frames. At the end a BODY element is used to provide an alternate document for non frame based renderings.

In the following example the NOFRAMES element is used to include in a document a table of contents which is otherwise displayed in a separate frame.

<BODY>
<H1>The Different Fish Species</H1>

<NOFRAMES> <!-- TOC for no frames display -->
    <UL>
        <LI><a href=#sec1>The fresh and sea water species</a>
        <LI><a href=#sec2>A subjective comparison</a>
    </UL>
</NOFRAMES>

<H1><a name=sec1>The fresh and sea water species</a></H1>

Fishes can be classified into several categories starting by the type of water in which they live. ... <H1><a name=sec2>A subjective comparison</a></H1>

This section is clearly not objective. I much prefer sea water fishes which are generally speaking more colorful and therefore more beautiful. ... </BODY>

Frames Implementation Notes

These are some issues with implementing grids, and suggested solutions.

Nesting FRAMESET elements

FRAMESET tags can be nested, as per the Frame Syntax description. But such a structure is basically flattened before display on the screen.

Of more importance is whether a FRAME can contain a document which is itself a FRAMESET. The answer is yes, but FRAMESETs must be nestable, especially with named frames, so that a link in one frame can reload multiple other frames.

Infinite Recursion

It is possible to design a FRAMESET that recurses infinitely, stacking the same FRAMESET inside itself until a machine runs out of memory. Consider this example:

<FRAMESET rows="50%,50%">
  <FRAME src="parent_url">
  <FRAME>
</FRAMESET>

Infinite recursion is prevented. Any frame that attempts to assign as its SRC a URL used by any of its ancestors is treated as if it has no SRC URL at all (basically a blank frame). This doesn't prevent all malicious documents, but it eliminates a troublesome class of them.

The IFRAME proposal

The IFRAME element is very similar to the FRAME element but is designed to be used in a BODY element instead of a FRAMESET. It defines a frame which takes place in the document flow, the way images inserted with the IMG element do. IFRAME is a text level element, it does not cause a paragraph break. Just like a FRAME, an IFRAME can be targeted, and navigated independent of the parent document.

The IFRAME element is a container. The end-tag is required. The contents are ignored by user agents that support IFRAME allowing alternative content to be supplied to down-level browsers.

Most attributes of the FRAME element are attributes of IFRAME. These are SRC, NAME, FRAMEBORDER, MARGINWIDTH, MARGINHEIGHT, SCROLLING. But IFRAME does not have the attribute NORESIZE; an inline frame is not resizable. And it has the additional attribute ALIGN which has the same value and meaning as the one of the IMG element.

src="address"
Specifies the address of the document to be displayed in the frame.
name
Provides a target name for the frame.
frameborder="1|0"
Triggers the display of a border around the frame. "1" (default) inserts a border. "0" displays no border.
marginwidth
Controls the margin width for the frame, in pixels.
marginheight
Controls the margin height for the frame, in pixels.
scrolling="yes|no|auto"
Specifies whether the frame should have scrolbars or not. Default is "auto".
width
Specifies the width of the inline frame, in pixels.
height
Specifies the height of the inline frame, in pixels.
align="left|middle|right|top|bottom"
Specifies how the frame is positioned relative to the current text line in which it occurs. The default is bottom.

Examples

<BODY>
  <P>This document contains an inline frame here <IFRAME
  src="foo.html" width=400 height=500> that unfortunately your user
  agent doesn't support. Alternatively you can get the related document
  <a href="foo.html">here</a>.</IFRAME> That's all folks!
</BODY>

The following example shows how targets can be used with an inline frame.

<BODY>
  <P>This document contains an inline frame
  <IFRAME name="iframe" width=400 height=500></IFRAME>
  in which you can choose to see various documents. These are:
  <UL>
  <LI><A target="iframe" href="http://www.sgmlopen.org/">
       SGML Open Home Page</A></LI>
  <LI><A target="iframe" href="http://www.w3.org/">
       W3 Consortium Home Page</A></LI>
  </UL>
</BODY>

Clicking on the first anchor will cause the document http://www.sgmlopen.org/ to be displayed in the inline frame, named "iframe"; clicking on the second anchor will cause the document http://www.w3.org/ to be displayed in this same frame.

IFRAME vs OBJECT

Although a means for creating compound documents is recognized to be a real need the introduction of IFRAME to meet this need is arguable. The main reason is that compound documents can already be created using the existing OBJECT element. Indeed, the purpose of IFRAME is to provide authors with a way to insert HTML documents into an HTML document. At the same time the OBJECT element is designed to provide a general mechanism to insert any type of object into an HTML document. Based on this and given that an HTML document is only a particular type of object, it is reasonable to claim that IFRAME is not necessary, and that OBJECT should be used instead.

This section discusses this issue, providing various elements of comparison and what it would take to allow authors to actually use OBJECT instead of IFRAME.

Similarities

Both elements allow you to insert an HTML document. Both of them are textlevel elements and do not cause a paragraph break. They are both containers supporting downlevel browsers in the same way; their contents are not rendered by user agents which support the element. So these elements are completely equivalent in these regards.

Differences

The IFRAME element, as defined in this document, is however different from the OBJECT element since it provides a set of attributes which are not available on OBJECT. These attributes are: SRC, FRAMEBORDER, MARGINWIDTH, MARGINHEIGHT and SCROLLING. To which we must add the NAME attribute which is available on both elements but has a different meaning.

Dealing with differences

The DATA attribute of OBJECT is equivalent to SRC and can be used in the same way.

The FRAMEBORDER, MARGINWIDTH and MARGINHEIGHT have no equivalent on OBJECT. Using OBJECT these have to be specified through the style sheet or alternatively via a set of PARAM elements.

SCROLLING has no equivalent on OBJECT and needs to be specified via a PARAM element.

Based on this, the basic example:

  <IFRAME src="foo.html" width=400 height=500>
  that unfortunately your user agent doesn't support. Alternatively you
  can get the related document <a href="foo.html">here</a>.
  </IFRAME>
Becomes:
  <OBJECT data="foo.html" width=400 height=500>
  that unfortunately your user agent doesn't support. Alternatively you
  can get the related document <a href="foo.html">here</a>.
  </OBJECT>

And the more complex example:

  <IFRAME src="foo.html" width=400 height=500 scrolling=auto
     frameborder=1>
  that unfortunately your user agent doesn't support. Alternatively you
  can get the related document <a href="foo.html">here</a>.
  </IFRAME>
Becomes:
  <OBJECT src="foo.html" width=400 height=500>
  <PARAME name=scrolling value=auto>
  <PARAME name=frameborder value=1>
  that unfortunately your user agent doesn't support. Alternatively you
  can get the related document <a href="foo.html">here</a>.
  </OBJECT>

The last difference is that IFRAME can be given a name, via its NAME attribute, so that it can be used as a link target as shown below.

<BODY>
  <P>This document contains an inline frame
  <IFRAME name="iframe" width=400 height=500></IFRAME>
  in which you can choose to see various documents. These are:
  <UL>
  <LI><A target="iframe" href="http://www.sgmlopen.org/">
       SGML Open Home Page</A></LI>
  <LI><A target="iframe" href="http://www.w3.org/">
       W3 Consortium Home Page</A></LI>
  </UL>
</BODY>

The NAME attribute on OBJECT has a specific semantic and cannot be used for that purpose. Therefore, to specify a target name on an OBJECT the ID attribute has to be used instead. This leads to the following:

<BODY>
  <P>This document contains an inline frame
  <OBJECT id="iframe" width=400 height=500></OBJECT>
  in which you can choose to see various documents. These are:
  <UL>
  <LI><A target="iframe" href="http://www.sgmlopen.org/">
       SGML Open Home Page</A></LI>
  <LI><A target="iframe" href="http://www.w3.org/">
       W3 Consortium Home Page</A></LI>
  </UL>
</BODY>

This is no big deal but it has a disadvantage though. The way authors specify target names on OBJECT and FRAME (ID vs NAME) becomes inconsistent. One way to solve this, is to deprecate the NAME attribute on FRAME and specify that ID should be used uniformly.

DTD Fragment for Frames

The following declarations define the proposed HTML frames support.

<!ELEMENT FRAMESET - - (FRAMESET|FRAME)+>
<!ATTLIST FRAMESET
  -- absolute pixel values, percentages or relative scales. --
  rows        CDATA      #IMPLIED  -- if not given, default is 1 row --
  cols        CDATA      #IMPLIED  -- if not given, default is 1 column --
  onLoad      CDATA      #IMPLIED  -- intrinsic event -- 
  onUnload    CDATA      #IMPLIED  -- intrinsic event -- 
  >

<!-- reserved frame names start with "_" otherwise starts with letter -->
<!ELEMENT FRAME - O EMPTY>
<!ATTLIST FRAME
  name        CDATA      #IMPLIED  -- name of frame for targetting --
  src         %URL       #IMPLIED  -- source of frame content --
  frameborder (1|0)      1         -- request frame separators? --
  marginwidth %Pixels    #IMPLIED  -- margin widths in pixels --
  marginheight %Pixels   #IMPLIED  -- margin height in pixels --
  noresize    (noresize) #IMPLIED  -- allow users to resize frames? --
  scrolling (yes|no|auto) auto     -- scrollbar or none --
  >

<!ELEMENT IFRAME - - %body.content>
<!ATTLIST IFRAME
  name        CDATA      #IMPLIED  -- name of frame for targetting --
  src         %URL       #IMPLIED  -- source of frame content --
  frameborder (1|0)      1         -- request frame borders? --
  marginwidth %Pixels    #IMPLIED  -- margin widths in pixels --
  marginheight %Pixels   #IMPLIED  -- margin height in pixels --
  scrolling (yes|no|auto) auto     -- scrollbar or none --
  align       %IAlign    #IMPLIED  -- vertical or horizontal alignment --
  >

<!ELEMENT NOFRAMES - - %body.content>

Remarks

Because frames were deployed in various products before it was properly specified as part of HTML several features are available in some products but are not standard. Here are some of them:

framespacing
FRAMESPACING is an attribute of FRAMESET which is supported by Internet Explorer 3.0. It allows to define additional space between frames. The amount defined for FRAMESPACING does not include the width of theFRAMEBORDER. FRAMESPACING can be set on one or more framesets and applies to the contained framesets unless the contained frameset elements define a different value. The default value is "2".
bordercolor
An attribute of FRAME supported by Navigator 3.0 which can be used to set the color of the separator drawn between frames.

These attributes are limited to presentation properties and can better be specified using a style sheet.

Pending Issues

Copyright  ©  1997 W3C (MIT, INRIA, Keio ), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.