October 23, 2011

HTML - Frames in Rows

It is also possible to create frames in rows. Row frames are set up from top to bottom of the page. Below is the code used to create frames in rows.

<html>
<head>
<title>Frameset</title>
</head>
<frameset rows="30%,70%">
<frame src="frame1.html">
<frame src="frame2.html">
<noframes>Your browser does not support frames.
<a href="noframe.html">Click here to see this webpage
without frames</a>
</noframes>
</frameset>
</html>

The previous code will be displayed by the browser this way…

Frames in rows

Frames in Columns and Rows

You can also add rows to the previous HTML file that we had been created a while ago. Open your text editor now and key in the next code.
<html>
<head>
<title>Frameset</title>
</head>
<frameset cols="30%,70%">

<frameset rows="50%,50%">
<frame src="frame1.html">
<frame src="frame2.html">
</frameset>

<frameset rows="50%,50%">
<frame src="frame3.html">
<frame src="frame4.html">
</frameset>

<noframes>Your browser does not support frames.
<a href="noframe.html">Click here to see this webpage 
without frames</a>
</noframes>

</frameset>
</html>

The previous code will be displayed by the browser this way…
Frames in rows and columns


This is how the code works (see illustration below).
Click to enlarge. Frames in rows and columns


Based on the above code, which html files are positioned on the first column of the page? How about the html files located on the second column? That’s right! Frame1.html and frame2.html will be displayed on the first column of the webpage, while frame3.html and frame4.html will be displayed on the second column of the webpage.

Which HTML files are located on the first row? How about in the second row? You’re correct! Frame1.html and frame3.html will be displayed on the first row of the page, while frame2.html and frame4.html will be displayed on the second row of the page.

0 comments: