Frames

Using frames allows you to set up windows within your browser's window, and display a different HTML file in each of these subwindows. To create frames you use the <FRAMESET></FRAMSET> tags. Inside the opening <FRAMESET> tag you use the COLS and ROWS attributes to define how big the frames will be. These values can be in pixels or percentages. An asterick is used to mean "use the rest of the window."

There are a number of tags that go inside of the <FRAMESET> tags. These include MARGINHEIGHT and MARGINWIDTH which take numbers, NORESIZE and SCROLLING which take "yes", "no" or "auto". The one required tag is SRC, which is used to define the file being displayed in the frame.

Here is a sample of code that would define a single frame which occupies 92% of the main window, and displays an HTML file called main.html inside of it.

<FRAMSET COLS = "92%, *">
<FRAME SRC = "main.html"
NAME = "menu"
MARGINHEIGHT = "0"
MARGINWIDTH = "0"
SCROLLING = "0"
NORESIZE>
</FRAMESET>
<NOFRAMES>
A non-frame version of your web site should go here.

READ THIS!!! When using frames it is very important to make sure that your site is easy to navigate through. Make sure that you have a menu on every page. Also make sure that every link within your web site that does not link to one of your pages which has the following attribute: TARGET="_top".

Go to an example on Frames...

Go back to Main Page...