Text Links Ads : Marketing Tips Store : Search Engine Optimization Strategies
WebPosition Gold Pro : Domain Registration Bank : Optilink Software : GoDefy
Mike's Marketing Tools : Mike's Ecommerce Software : Text Links Guide
 
Web HTML-HTML.com
You are here: HTML Codes > Frames

Frames Tutorial

Let's look at a basic example of how frames work:

The frameset file... The frameset file is the file you point your browser to. The frameset file uses <FRAMESET ...> and <FRAME ...> to tell the browser to go get more files to put on the page.
tells the browser to go get these four files The browser goes out again and retrieves the files which will appear on the page.
and put them all on one page in separate rectangles ('frames'). The browser puts all the files on one page in separate rectangles ("frames"). The user never sees anything from the original frameset file.

Think of frames as creating a "table of documents" on the page. Like a table, a group of frames has rows and columns. Each cell of the table contains a document which is stored in a separate file. <FRAMESET ...> defines the beginning and end of the table, and how many rows and columns that table will have.<FRAME ...> defines what will go into each cell ("frame") of the table.

Let's look in more detail at the example above. The entire contents of basicframeset.html (the frameset file) look like this:

This code ... creates this page (here's the real thing)
<HTML>
<HEAD>
<TITLE>A Basic Example of Frames</TITLE>
</HEAD>
<FRAMESET ROWS="75%, *" COLS="*, 40%">
 <FRAME SRC="framea.html">
 <FRAME SRC="frameb.html">
 <FRAME SRC="framec.html">
 <FRAME SRC="framed.html">
 <NOFRAMES>
 <H1>No Frames? No Problem!</H1>
 Take a look at our 
 <A HREF="basic.noframes.html">no-frames</A> 
 version.
</NOFRAMES>
</FRAMESET>
</HTML>
Picture of a simple frameset

Here's a line-by-line explanation of each piece of code for the frames:

<FRAMESET
Start the "table of documents".

ROWS="75%, *"
The table should have two rows. The first row should take up 75% of the height of the page, the second should take up the rest.

COLS="*, 40%">
The table should also have two columns. The second column should take up 40% of the width of the page, the first column should take up the rest.

<FRAME SRC="framea.html">
<FRAME SRC="frameb.html">
<FRAME SRC="framec.html">
<FRAME SRC="framed.html">
Put the four files into the frames.

<NOFRAMES> ... </NOFRAMES>
Every framed page should have a no-frames alternative. The <NOFRAMES> content should go inside the outermost <FRAMESET ...> tag, usually just before the last </FRAMESET>. The most efficicent method for no-frames content is to link to a page which is specifically designed for no-frames.

</FRAMESET>
End the frameset.

there are several other aspects of frames to note from this example:

Nested Framesets >>>

Copyright © 2002-8 Art Dacor USA LLC. All Rights Reserved.
3727 West Magnolia Blvd #489, Burbank, CA, 91505, USA.
www.HTML-HTML.com