As you can supposition, this tag is utilized for placing an HTML file in the frame created. We have to now tell the browser what to put in each of frame.
Check out the code for all the FRAM ES associated examples. Do we need a <BODY> tag?
<HTML>
<HEAD>
<TITLE>My Frame Page- Master Page</TITLE>
</HEAD>
<FRAMESET COLS="50%,50%">
<FRAME SRC="One.htm">
<FRAME SRC="Two.htm">
</FRAMESET>
</HTML>
You also have to note here that <FRAMESET> is a container tag, and <FRAME> is not. A container tag contain an opening <TAG> and a closing </TAG>. Thus notice that the <FRAME> tag has no delimiter to terminate it. Everything is in its attributes.
The <FRAMESET> tag does all the splitting of the page into distinct windows. It also has attributes which indicate how to divide them up. Can we split the page into more than two pieces? Yes, just ensure that you indicate a page to occupy each of the section or the browser will get confused. Look at the code & the output in Figure
<HTML>
<HEAD>
<TITLE>My Frame Page- The Master Page</TITLE>
</HEAD>
<FRAMESET COLS="20%, 20%,20%,20%,20%">
<FRAME SRC="One.htm">
<FRAME SRC="Two.htm">
<FRAME SRC="Three.htm">
<FRAME SRC="Four.htm">
<FRAME SRC="Five.htm">
</FRAMESET>
</HTML>
Figure: A Web Page with Five Frames
It is just a small step to making the frames all of distinct sizes. Just ensure your arithmetic is correct and that the percentages you indicate add up to 100 or the browser will come up along with its own interpretation.
If we spilt the page into ROWS rather than COLS we get a distinct layout.
<HTML>
<HEAD>
<TITLE>My Frame Page- Master Page</TITLE>
</HEAD>
<FRAMESET ROWS="10%,20%,30%,15%,25%">
<FRAME SRC="One.htm">
<FRAME SRC="Two.htm">
<FRAME SRC="Three.htm">
<FRAME SRC="Four.htm">
<FRAME SRC="Five.htm">
</FRAMESET>
</HTML>
Now Let us take another example with only 2 frames. We can specify 50 to indicate that number of pixels instead of 50 percent. We can also use * instead of a number. The * means whatever is left over.
<HTML>
<HEAD>
<TITLE>My Frame Page- The Master Page</TITLE>
</HEAD>
<FRAMESET COLS="50,*">
<FRAME SRC="One.htm">
<FRAME SRC="Two.htm">
</FRAMESET>
</HTML>