Frames


Frames are very important in HTML. It gives much better organization to the webpage you are creating. If you dont know what frames are click here.


Frames are basically two or more webpages combined together. To do this, you must first make a wepage and then two other webpages to have as the frames.

Lets call the webpage frame.html and the frame on the left side frame1.html and the frame on the right frame 2.html. In the head of frame.html, you must put:


<head>
<frameset cols="25%,75%" frameborder=0 border=0 framespacing=0>
<frame name="frame1" src="frame1.html">
<frame name="frame2" src="frame2.html">
</frameset>
</head>


The tag to begin it with is <frameset>. This states that you are defining the frames of this webpage. Then you say cols="25%,75%". This means that the first column or frame is going to take up 25% of the page and the second column or frame is going to take up 75% of the page. When you do <frame name="frame1" src="frame.html">, you are stating the name of the frame and the source or the location of the frame.



Hyperlinking Frames


Now this is where naming frames becomes really useful. You may have already tried to hyperlink using your frames but instead the page just showed up in the same frame that you clicked the hyperlink. This is when you do this:
<a href="http://www.yahoo.com" target="frame2">
This will make the page appear in frame2 or the right column. Don't put frame2.html though because it will not work.