FRAME CONTENT

Frame Tag

Each FRAME tag specifies a single frame in a FRAMESET. Six attributes describe the frame content, name, margins, (width & height), whether it can be scrolled and resized. Since the FRAME tag does not contain other information it has no ending tag.

<FRAME

SRC="url"

NAME="windowName"

MARGINWIDTH="numberOfPixels"

MARGINHEIGHT="numberOfPixels"

SCROLLING="yes|no|auto"

NORESIZE>

Frame Attributes

The SRC="url" attribute gives the Web address of the initial document to be displayed in the frame. The NAME="windowName" attribute gives the frame a name which allows it to be referred to by other links for the purpose of changing the frame contents. Frame names must begin with a letter or digit. The MARGINWIDTH="numberOfPixels" and MARGINHEIGHT="numberOfPixels" attributes allows an author to set the margins inside the frame to prevent frame contents from touching the frame borders. The width and height attributes are optional and if omitted allow a browser to choose appropriate margins. The SCROLLING="yes|no|auto" attribute informs the browser if the frame has scrollbars all the time (yes), never (no) or whenever appropriate (auto, the default). The NORESIZE attribute prevents the user from changing the size of a frame.

Example

Extending the previous example from the layout section:

<FRAMESET COLS="25%,75%">

<FRAME SRC="left.html" NAME="left" NORESIZE>

<FRAMESET ROWS="10%,*,10%">

<FRAME SRC="right1.html" NAME="right1">
<FRAME SRC="right2.html"NAME="right2" SCROLLING="yes">
<FRAME SRC="right3.html"NAME="right3">

</FRAMESET>

</FRAMESET>

To view the above example in a new window click here.

NOFRAMES Tag

The NOFRAMES tag, (specified in the first frameset), allows a web designer to either provide alternate content for users without frame enabled browsers, or to give them a message indicating the tytpe of browser required for proper viewing or instructions on how to obtain an updated browser.

Example

Once again extending the previous example:

<FRAMESET COLS="25%,75%">

<FRAME SRC="left.html" NAME="left" NORESIZE>

<FRAMESET ROWS="10%,*,10%">

<NOFRAMES>
This document requires a Frame enabled Web browser
for proper viewing.
</NOFRAMES>

<FRAME SRC="right1.html" NAME="right1">
<FRAME SRC="right2.html"NAME="right2" SCROLLING="yes">
<FRAME SRC="right3.html"NAME="right3">

</FRAMESET>

</FRAMESET>

Frame browsers simply ignore everything between the NOFRAMES tags.