QuickRead 12: Frames
| A little perspective. | ||||||||||||||||||||||||
| Presenting information on a webpage has come a long way from the
simple and clunky first generation sites to the vastly advanced, bandwidth heavy, plug-in
addled sites of today. You'd be surprised at the number of folks still using old browsers
which do not understand popular new tags. These browsers do not have the capability to
accommodate some necessary plug-in either. Designing too fancy a site discriminates these
users and it's wise to go the middle ground and hope for people to catch up. Big companies
design their sites keeping in mind something called the "lowest common denominator." This is
described as a set of reasonable, educated, and "sometimes" researched assumptions about the
browsing capabilites of the user population at large. The most important capabilites you
will need to pay attention to for implementing Frames are those of screen resolution and
Frame capability. Explorers starting 3.0 and Navigators starting 2.0 are Frames capable. The
LCD as far as screen resolution is concerned is 640 x 480 pixels(width x height). | ||||||||||||||||||||||||
.
| .
| What are Frames?
| Frames are a HTML feature that allow multiple pages to be loaded and viewed at the
same time. The HTML document you are viewing right now is not frames based and therefore it occupies the
entire browser window. If it were frames based the browser window would (among the many possible
combinations) be split into two or more columns. The first column would load a HTML document, the
second column or frame would load a different HTML document and so forth... Here's an example.
| For instance, assume your homepage had five files: index.html(the file that loads first), images.html(a
photographs page), resume.html(resume page), hobby.html(stuff about your hobby), friends.html(short takes on
your friends). Normally, you would link to these four other pages from your index.html. When someone clicks
on the link, the browser loads that page and displays it. Now, the only way you can get back to your
index.html is by either hitting the "back" button on your browser or by providing a link back to your
index.html in the new page. For instance, if someone was really impressed with your animal skull collection
and had to see your pictures, they'd have to go to index.html, search for your pictures link and then click
on it[hobby.html to index.html to pictures.html]. Not too bad considering it's only two clicks away. But if
you were to have any luck with presenting a significant amount of information on the net, it's imperative
that you don't bury your stuff six or seven clicks away. Frames help you provide an intuitive navigational
interface. They also help in achieving some design and information presentation objectives. .
| .
| The frameset tag. <frameset
attributes>
| When you are designing using frames, the frameset tag replaces the
body tag used in the basic HTML document structure. The frameset tag defines the number of
columns or rows the page will have. For now, let's stick with having our frameset tag divide
the page into columns first. Here is how you'd do it: | <frameset cols="20%,80%">
The above statement divides the page into two columns. The first column occupies 20% of the screen width
and the second column occupies the other 80%. This statement divides the page into three columns. The first column occupies 100 pixels of screen width, the second occupies another 100 pixels and the third occupies whatever is left over. Pay attention to the three units used: the "%", the "px"(pixel) which is the default unit, and the "*" which means whatever is left over. Each of these columns can now load a different HTML document. Splitting the page into columns is the first step. The second step involves having to decide if you want to further divide any particular column by rows. Take a look at the code below:
<frameset cols="20%, 80%"> The first column is further divided into two rows by another frameset tag. The first row occupies 80% of the height and the second row occupies 20%. The <frame src> tag is used to identify the source of the HTML document for these frames. The name attribute used in each of these tags will be explained in just a while. The second column is left as is, with the only row defined occupying all the space. .
| .
| The target attribute
| If you had a link on one of your frames(let the name of the frame be "J") and you wanted the page to load on
another frame(called "K"), here's how you'd do it. Insert the following link in the HTML document loaded in frame J: <a
href=pagename.html target=framename>. pagename.html is the page your link is supposed to load. For achieving our objective, the
framename would be "K" because we want the page to load in frame K.
| Here are a few options for loading a new page.
|
| Index |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 |