What we'll discuss:
Frames
When to use frames (soon)
Tables (soon)
Why and when to use tables (soon)
Frames
If you have no clue what frames are, go here for an example. Click on some of the links on the left hand side and see how the right side reloads.
Frames are one of the biggest bones of contention on the net. Some people love them, and others absolutely detest them. If you plan on making your page with frames, I recommend making two sites: one with, and one without.
Frames work like one of those picture frames that holds multiple pictures: it shows multiple pages at once. If you click on a link on one of the sections, another section reloads while the other two remain the same.
To work with frames, you need to make three pages: one for you to link to from other pages, and two more html pages for the viewer to see.
The first page tells the computer how big the frames are, what each frame is called (so a link knows which frame to reload) and what page is initially shown in a frame. The html might look something like this:
<head><title>My Frames Page</title></head>
<frameset cols = "15%,*">
<frame marginwidth = 2 src = "menu.html" name = "menu">
<frame marginwidth = 2 src = "main.html" name = "window">
</frameset>
An explanation of all those tags:
Frameset |
This sets the size of the frames on the page. |
Cols |
Sets the page into multiple columns. The first one will take up 15% of the screen, and the next one will take up the rest of the space. |
Rows |
(not shown) If you want rows instead of columns, replace cols with rows |
Frame |
This tag contains information about one of the frames |
Marginwidth |
How much space is there in between frames? |
Marginheight |
(not show above) If your frames are one on top of the other, this is how you determine how much space is between them. |
Src |
Tells where the page is that you want to show up in that frame |
Name |
What the name of the frame is, so that if you click a link, you can tell the browser which frame to reload. |
Now, when you want to change one of the frames (not the one the link is in) you need an extra tag in the <a> tag: target. If I want a link in the "menu" frame to change what is shown in the "window" frame, my link needs to look like this:
<a href = "page2.html" target = "window">
That way, the browser knows where to load the new page.
This page hosted by
Geocities