Tech Tips

How to Use Frames in Web Pages

by Alex Smith, Demand Media

Frames are a simple tool in website design that allows you to display multiple web pages on the same screen. They are often used to display comparison data or to create menus and other features that can be updated without changing the rest of a website. A web page using frames is actually made of several parts: the page itself and one additional page per frame.

Step 1

Open a blank file in a text document or HTML editor.

Step 2

Save the file as "frames.html" or whatever name you want, as long as it ends in ".html".

Step 3

Copy and paste the following HTML code for vertical frames into the document:

Step 4

Add a page title between "" and "." This will appear at the top of the browser window.

Step 5

Set the "FRAMESET COLS." The two percentages will tell the browser how much of the screen is in each frame. For example, "50%, 50%" will divide the screen evenly in half. "75%, 25%" will create one frame that fills 3/4 of the screen, then another that is 1/4.

Step 6

Enter the URLs of the web pages you want to appear in the "FRAME SRC" lines. The first one is for the left side, the second is for the right.

Step 7

Save the file and view it in a browser window. The two web pages you designated will appear side by side in your frames page.

Step 8

Add a third frame by altering the code as follows:

Step 9

Replace "FRAMESET COLS" with "FRAMESET ROWS" for horizontal frames. The percentage and SRC apply now from top to bottom instead of left to right.

About the Author

Alex Smith began writing in 2006 and brings a combination of education and humor to various websites. He holds a Master of Arts in theater and works as a professional makeup and special-effects artist.

TopLeft