|
Jim Hanson's
Frames allow multiple HTML documents to be loaded on the same page.
Frames can be left on screen and have links to change other frame content without changing themselves.
FRAME BASICS A Frameset document has the basic structure of a HTML document, except the BODY container is replaced by a FRAMESET container which describes the sub-HTML documents, or FRAMES, that will make up the page. (CAUTION: Putting the FRAMESET data inside the <BODY> tags will cause the FRAMESET to be ignored.)
|
The source code and frame structure for frameset document for this example are shown below.
The * in the "rows" parameter allows the browser to assign whatever space is left. For the two row elements, the first row (called Right Top below) will get 20% of the space while the second, Right Bottom, will get the remainder of the space. If you specify *,*, each row will get half the space.So, you can also specify PERCENT OF WIDTH, NUMBER OF PIXELS, or * to assign the amount of space you want for a frame row or column.
Left
  ;
|
Right Top |
Right Bottom
|
Here it is without borders. This effect is made by adding the parameters FRAMEBORDER=NO and BORDER=0 to the FRAMESET tag.
The source code for the frameset document
contains links to body documents Fleft.htm, Ftop.htm, and FB1.htm. These are just regular HTML documents, and they are even viewable with a browser that does not support the frames extensions. FB1.htm and FB2.htm will be loaded into the bottom right frame as directed by the links in Fleft.htm specifying their TARGET as rbottom.
Example of code in Fleft.htm that loads FB2.htm into the right bottom frame:
If you want the new page to be loaded into a new browser window, you should specify TARGET="_blank". To load the page into the same window as the current FRAMESET document, overwritting the whole browser window, add TARGET="_parent" to the tag. You can view the source of the examples by selecting:
The title bar on the browser window shown will be the primary frameset document that caused the frames to be loaded, not the HTML documents that are loaded into the frames. You can click on a frame and then select View, Frame Data to get info on the frame contents.
<A HREF="FB2.htm" TARGET=rbottom>Page 2</A>When creating links in one frame for documents to load in another frame, make sure you include the TARGET="frame_name" in the <A HREF=...> tag. If you don't specify the name of the frame (matching the NAME parameter in the FRAME tag) the page will be loaded into the frame it is referenced from.
to see the frame documents.
Copyright © 1998 Jim Hanson Last update:Jan. 22, 1998
Member of the Internet Link Exchange | Free Home Pages at GeoCities |