How To Create A Frame On Your Web Page

Before you consider using frames to design your website, consider the potential problems. There are some browsers that cannot properly view frames. At times when you do use a frame and have links which connect to other sites, you can have their web sites trapped within your frames or have your frame break unexpectedly if it goes outside of your control.

Why would one consider a frame? Most who do it are often borrowing content from other people's websites. They will have a top part to brand their own website with the bottom part being content from another website. This give the appearance that all of the content is actually on the same website which can be quite deceiving.

Others just like to keep a table of content or a header or both and connect the rest of their site in this method to save on bandwidth so those features would not constantly be re-loaded. Of course, if you use a style sheet for some of these elements, it will cut down on bandwidth usage.

Frames are two or more web pages that appear in one screen. In order to create this, you must first decide where you want the different pages to appear. You can do the most common frame where the two pages are side by side or one page on top of the other. Sometime you can even combine top, side, middle and bottom or any combination you can think of. You also have an option, if you wish, to have your frames able to scroll or to just be still. Like any type of web design, it is best to map out your idea on paper before you start.

First create the design you have in mind on paper. Then design each web page that will appear in the frames. Most who choose to use frames do so in order to keep the contents of the web site on one side and the page to pop up on the other side when the surfer clicks on a link. To insure that will happen, you must target each link on your site to appear in the other side of the frame. So when you do the link you must add to it target="home" for example:

<a href="http://www.yoursite.com/pagethree.html" target="home"></a>

You can create what is called a frame, or a page that combines all of the pages you made to show up at that location.

You see, a frame will be the URL you type in to see all of these pages at the same time in the sections you direct. The most common frames will designate one side of the screen for showing the pages linked to one of the pages in the frames. For instance, pageone.html could have the table of contents of your web site and pagetwo.html could just be your welcome page, but you want the surfer to click on one of the links of your table of contents to appear where your welcome page is at the start. That place where all of your links will be designated to appear will be "home". Thus you must first start your frame with this command:

<base target="home">

This example is one of a simple side by side frame joining two web pages into one frame. First you must determine how much space on the screen your frames will occupy and how much of a border (in pixels) you want between each page. If you want it half and half with a narrow border, try this:

<frameset cols="50%,*" frameborder="0">

This part gets kind of complicated. You are now joining two pages together. Let's say you had pageone.html you wanted on the left of the screen and pagetwo.html on the right of the screen. Your first side of the screen would be frame name "one" and the other side frame name "two". If your pages are more than one screenful, you will want to make sure you can scroll them and need to specify "yes" to scrolling, but if the pages are in one screenful, you can put "no" as your option.

<frame name="one" src="pageone.html" frameborder="0" scrolling="yes">

<frame name="two" src="pagetwo.html" frameborder="0" scrolling="yes">

Then be sure you have an option open for those who have browsers that do not support frames.

<noframes>

In between these tags you should have something for those without the ability of viewing frames to see. In other words, create a single web page in this space that does not need a frame.

</noframes>

Then you close the frame with this:

</frameset>

Thus your frame page will look like this:

<html>
<head>
<title></title>
<meta name="keywords" content="">
<meta name="Generator" content="HTMLpad">
</head>
<base target="home">
<frameset cols="50%,*" frameborder="0">
<frame name="one" src="pageone.html" frameborder="0" scrolling="yes">
<frame name="two" src="pagetwo.html" frameborder="0" scrolling="yes">
<noframes>
< !-- Support for browsers that don't support frames -->
</noframes>
<body bgcolor="#00FFFF" text="#000000" link="FF0000">

Your web page content here for those who can't view frames.

</body>
</frameset>
</html>

And if all of your links are in the frame named "one" and you want those links to appear in the frame you named "two" all the links would be the URL plus a target order such as <a href="six.html" target="two">

When you are doing a website, please reconsider using the frame format. While it can be done, you will still lose some of your audience.

JCE Enterprises Web Sites

JCE Enterprises Related Sites