The Frames Resource


You came here to learn something about Frames. So here's a brief introduction into the mysteries of the frames HTML.
I have arranged this introduction in four parts:


1.) The Tags

"x" indicates an input value
"|" stands between alternatives

<frameset>
is equivalent to the <body> tag

</frameset>
is equivalent to the </body> tag
<frameset rows="x,x">
to set two frame areas, divided horizontally, and define their size; x can be given in pixels or percent; to assign "the rest of the screen" to one of the areas, enter "*" as width.

<frameset cols="x,x">
to set two frame areas, divided vertically, and define their size; x can be given in pixels or percent; to assign "the rest of the screen" to one of the areas, enter "*" as width.

<frameset frameborder="yes"|"no" >
allow/disallow a borderline between frame areas

<frameset bordercolor="#hhhhhh">
set a color for the borderlines; #hhhhhh is a hexadecimal code

<frameset border="x">
"x" defines the width of the borderline in pixels

You can combine two ore more of these definitions into the <frameset> tag; e.g.
<frameset rows="150,100,*" border="2" bordercolor="#0000ff">
Would define a frameset with three areas arranged horizontally, the first area being 150 pixels high, the second one 100 pixels, the third one filling the rest of the window space; they will be divided by a 2 pxiels wide blue borderline.



<frame>
defines the contents of the single frame

<frame src="URL">
gives the HTML source for the frame

<frame name="name">
assigns a name to the frame area, important if you link to it.

<frame marginwidth="x">
"x" defines the width (in pixels) of the left and right margin of the frame

<frame marginheight="x">
"x" defines the height (in pixels) of the top and bottom margin of the frame

<frame noresize>
disallows any size modification by the viewer; if you leave this command out, a visitor may change the size of the frame in his browser display.

<frame scrolling="yes"|"no"|"auto">
defines a scollbar at the frame's margin. "yes" and "no" are general settings, "auto" lets a scrollbar appear only if necessary (that is, if the content of the frame can't be displayed in the frame completely

You can combine two ore more of these definitions into the <frame> tag; e.g.
<frame source="mypage.htm" name="frame1" noresize scrolling="no">
Would define the document "mypage.htm" to be displayed in a non-resizeable frame with no scrollbars


<noframes>
is the <body> tag for contents to be displayed by browsers not able of displaying frames

</noframes>
is the </body> tag for contents to be displayed by browsers not able of displaying frames

You should add a short message for visitors using non-frames-browsers, leading them to a page without frames


2.) Frame Syntax

A frame document is verz similar to a normal HTMl file. The <body> tag is being replaced by the <frameset> tag which defines the documents and frames that will be combined to the page

.

Thus, the minimum requirement for such a document is:
<html>
<head>
</head>
<frameset>
</frameset>
</html>

In the <frameset> tag, you define the general layout of the page. You can define how many frame areas (rows or columns) will be displayed and how large they should be. There is a certain problem with the absolute with in pixels, since the width of the display varies from browser to browser and from monitor to monitor. Thus, the document is very likely to appear totally different on another visitor's display. You should preferably use the relative width in percent. In case the assigned values do not total exactly to 100%, the browser will override the settings to correct this.
<frameset> tags can be nested. The subframes will be displayed in the space that would be used for the corresponding frame if this had been a <frame> tag instead.

That's for the theory. If you want to see some examples and example source codes, go here.

If you have any questions, please do not hesitate to write me an email.



Made 1998 by wohli (Jan Wohlgemuth).


Hosted by www.Geocities.ws

1