Getting started with frames
Basic HTML tags: <FRAMESET> , <FRAME
SRC> and <NOFRAMES>
The <FRAMESET> Tag
This tag defines the size of the frames in the page, defined by the <FRAME
SRC> tags.
It appears above and below the < BODY>...< /BODY> tags and
below the HEAD tags.
FRAME SRC tags go within the FRAMESET. You can define the rows or
the columns with this tag, but not both at the same time. The values can be defined
in three ways:
- Percentage of the Window size.
- <FRAMESET COLS="50%,50%">
The browser window is divided in the middle
- Relative measurement of the window size.
- <FRAMESET COLS="*,*">
Same effect as above
- Absolute measurement in pixels.
- <FRAMESET COLS="100, 50, *"> Three columns, 100 and 50 pixels
wide, and the remainder is taken by the third.
The <FRAME SRC> Tag
This tag tells the browser which fileto display in the frame.
For example, <FRAME SRC="index.html"> This tag displays the content
of the index.html file in the frame.
Scroll Bars:
The browser, depending on the length of the screen, will put scrollbars within
the frame.
To control the presence of the scrollbars with the SCROLLING attribute, which
has the following values: NO, YES, and AUTO.
- NO tells the browser to omit the scrollbars.
- YES includes them.
- AUTO puts them in if necessary.
The default setting is AUTO.
For example, <FRAME SRC="index.html" SCROLLING="no"> will omit the
scrollbars.
To put everything together, here is a sample HTML file that uses frames:
<HTML>
<HEAD>
<TITLE>Framed document</TITLE>
</HEAD>
<FRAMESET COLS="*,2*">
<FRAME SRC="first_frame.html">
<FRAME SRC="second_frame.html">
</FRAMESET>
</HTML>
See how the above example looks like
<NOFRAMES>
You can use the NOFRAMES tag within the FRAMESET tags to provide
alternative content for browsers that do not support frames. This is a good idea
to make your pages most accessible. If you do not provide this, the page will
appear blank to a Lynx user or a graphical browser that does not support FRAMES.
<HTML>
<HEAD>
<TITLE>Framed document</TITLE>
</HEAD>
<FRAMESET COLS="*,2*">
<FRAME SRC="first_frame.html">
<FRAME SRC="second_frame.html">
<NOFRAMES>
<body>
<A HREF="first_frame.html"> Information on Companies </A>
<A HREF="second_frame.html"> Information on Individuals</A>
</body>
</NOFRAMES>
</FRAMESET>
</HTML>
Return to Basic and and Advanced Frames Tutorial
VIA Guides, Last updated on 10/31/96
Developed by Boris
Soposki for VIA
|