
By using Frames, a single browser window can
be sub-divided into sections, each displaying a different page. Let us
first try to use frames to show two pages in the same window. Below are
the pictures and descriptions of the three necessary pages you would need
to create.
 |
 |
 |
| A regular HTML page that will become the left
frame in the resulting page. So, the contents that will be shown on the
left side of the resulting frame page should be written here. |
A regular HTML page that will become the right
frame in the resulting page. So, the contents to be displayed on the right
side should be written in the HTML code. |
This page specifies how the browser window is
divided into (in this case) 2 frames. It determines how the browser window
is split and also in which frame left.htm and right.htm are to be displayed. |
In creating a page with frames, the page of most
importance is the frameset page. Above, this page is index.htm. The reason
for its importance is that this page is the what combines the other pages
into a frameset using frames. Therefore, we'll mainly discuss the HTML
coding of the frameset page.
The frameset page should include these pairs of HTML tags:
| <Frameset> </Frameset> |
A
frameset divides a browser window using a
set of frames. In the above case, the frameset would be index.htm(l). Just
like how <table> and </table> determine the beginning and end of
a table, <frameset> and </frameset> state the beginning and the end
of a frameset. This tag, as stated above, takes the place of the body tags
in index.htm(l). Unlike the body tags, these tags contain and can only contain the frame tags listed here. So, between
<Frameset> and </Frameset> there shouldonly be<frame...>, <noframe>, or another<frameset>. |
| <Frame> </Frame> |
These tags, nested inside the <frameset>
tags, signifies a single frame in the frameset. |
| <NoFrame> </NoFrame> |
These tags are not needed to create a page with
frames, but instead are helpful to older browsers that don't support frames.
Between these tags all regular HTML coding, whatever <frameset> restricts,
will be understood. Though you could go through the trouble and create
an entire no frames version for every frames page, I would suggest that
you simply create link(s) to the main htm(l) page(s) that the frames version
would have displayed together. |
Attributes
of <Frameset> and <Frame>
(Required symbols are in bold )
Rows="pixel#, #% or *"
Rows="height list" |
This 'attribute' creates frames by rows. Meaning
that you end up with horizontal frames. This determines both the number
of horizontal frames and also the height of each of them. In between the
quotations should be a list of numbers. A list with two numbers would indicate
2 frames, a list with three means 3 horizontal frames and so on. The numbers
themselves set the height in order from top to bottom. A number value can
represent either exact pixel count or a percent (w/ % sign). Another option
is the multiplication sign (*), which means to make the remaining height,
the height of the frame. Example |
Cols="pixel#, #% or * "
Cols= "width list" |
The only difference from 'rows', is that 'cols'
creates vertical frames from left to right. The 'resulting frame' page
at the beginning of this page would have used a 'cols=' and two width values.
Example |
frameborder=0
framespaceing=0 |
Placing these two attributes within the <frameset>
would make the ENTIRE frameset borderless, meaning that there will be no
border between ANY frames. Having borders is default. |
| src= 'link' |
<frame src> means frame source, like <img src>.
In the quotations, type in the page that you wish to display as if you were linking to it.
I don't quite consider 'src'an attribute since every <frame> tag has to have a src,
just like <img src>. And since there is always two or more frames, there will
always be more than one <frame src>. The order of the <frame src>'s are important.
They should be arranged in the same order as the height or width list in <frameset>.
By thisI mean that if creating <frameset rows= "342, *, 20%"> (three horizontal frames),
then, the page you wish to be displayed on top (w/ the height of 342 pixels) should be
the first <frame src>, and lastly would be the page displayed on the bottom
(with a height of 20%). If it was <frameset cols="342, 32%, *"> then the page you
wish to be displayed on the left (with a width of 342 pixels) should be listed first. |
frameborder=0
framespacing=0 |
Placing these attributes within the <frame>
tag instead of <frameset> would specify only that frame to be borderless. |
| scrolling="yes,no" |
Determines whether or not a frame can have scrollbars to scroll
down the page displayed in the frame. The default (yes) is prefered, since not every surfer
has the same resolution. |
| noresize |
Placing this within the frame tag will prevents
the default resizing of the frame. |
| name= "frame name" |
This assigns a name to a frame. The main purpose of
this is if you wish to specify a link to be opened in a particular frame.
This would require however, to place a 'target=targetname' attribute within the
<a href> link tag, which would be in one of the pages that the frameset page
assembled together. The target name must match the frame name in order for
the link to be opened in that frame. Example .
<a href target= "... "> :
- "_self" -- the link will load in the
frame where the link is.
- "_blank" -- the link will load in a new
window
- "_top" -- the link will break out of the frames
|
Frame pages often use both <frameset rows=...> and
<frameset cols=...>. Rows and Cols are usually combined to form a page with a header
(perhaps to place a banner), and two vertical frames. Here is an
Example.
|