NEW!!! Get examples of frame sets in this page:
HTML examples and precooked sets!!!
Frames! Everyone would like to have them in their own site. They enhance the looks of the pages, giving them a professional appearance and a sense and feel of integration and easier navigation. Are frames that difficult? Don't think so. Frame implementation is quite easy.
Here's where my advice about files and organization will work perfectly: having all your files in a single directory will make easier the transport of your personal web to other places, and preview it easily.
First: create a main page (usually you would name it "index.html"), long file names come in handy. That page should have all of the basic elements normally found on a web page, (<HTML>, <TITLE> and <HEAD> tags) except the <BODY> tags.
Where the <BODY> tags should be, put a <FRAMESET> tag. This tag will begin the frame set processing on the browser. The parameters for the <FRAMESET> tag are the following:
After that, put a closing </FRAMESET> tag.
That's all! Would you believe that? Now you've got a document set, let's say index.html, navbar.html and content.html and you want to frame them. What would you do? I'd do the following in index.html:
<HTML> <HEAD> <TITLE>Index document</TITLE> </HEAD> <FRAMESET ROWS="*,100"> <FRAME SRC="content.html" NAME="Contents"> <FRAME SRC="navbar.html" NAME="Navigation bar"> </FRAMESET> </HTML>
That would load "content.html" in the big frame, and "navbar.html" in the 100 pixel high frame. You don't have to do any changes to the referenced documents. The former example gave me a window divided in two rows, one below with 100 pixels height, and the other in the upper part of the window. The upper division was named "Contents" and displayed content.html, while the lower was named "Navigation bar" and showed navbar.html. That's why it is important to name the frames consistently.
Now, in this example, I made the bottom division very small (100 pixels high), because I intended to include a navigation bar in there, with links that would let me navigate across the upper page (content.html). So, with our knowledge about tables, hyperlinks and bookmarks, we'll create a navigation bar for that document. Since "content.html" is very long and contains three sections, Part1, Part2 and Part3, we'll set a table with links to all these sections. We'll asume the bookmarks are already defined in "content.html" and we will only work around "navbar.html".
What to do:
<TABLE> <TR> <TD><A HREF="content.html#Part1" TARGET="Contents"> Part 1</A></TD> <TD><A HREF="content.html#Part2" TARGET="Contents"> Part 2</A></TD> <TD><A HREF="content.html#Part3" TARGET="Contents"> Part 3</A></TD> </TR> </TABLE>
The TARGET argument in the <A HREF> tag tells the browser to load the link into the specified frame or window, named in the FRAME tags. Or, instead of a frame name, you can put "_top" to load into the full window, "_self" to load in the same frame, and "_blank" on a new, blank window. Handy, isn't it? This is the way the navigation bar at your left is built, just that instead of saying Part 1, 2 or 3, I nested graphics on the hyperlinks, specifying BORDER=0 in the IMG tags, to avoid the display of a nasty blue border around my little nifty graphics.
Tip posted by The Omega. Thanks a lot for this. You got another link!
URL: http://www.oocities.org/Area51/Corridor/4381
The <NOFRAMES> tag is for people who don't have frames. It is used like this:
<NOFRAMES> <BODY> type here stuff for no-frames people </BODY> </NOFRAMES>
Text inside the <NOFRAMES> tag won't be displayed by frames-enabled browsers, so be cool and place there some info to help people using frames-disabled browsers. Place the <NOFRAMES> tags after the frame set, and do not put any body tags outside them.
One more thing about frames: there are other kind of frames, such as floating and embedded frames. These go beyond the scope of this document yet. For now, use your preferred search engine to look up information about these. I'm working on it now.
Member of the ILE | Free Home Pages at GeoCities |