CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

[HTML] Putting frames in your webpage


[Reply] [View by Thread] [Help]
[Back To Article Discussion Forum]

Posted by Author theeye On 2007-04-29 10:02:30




View and vote on the article here: Putting frames in your webpage


Putting frames in your webpage

Category
HTML
Summary
Body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]
<html xmlns="http://www.w3.org/1999/xhtml]
<head>
<title>Putting Frames in a Webpage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css]
<!--
.style1 {font-size: small}
-->
</style>
</head>
<body>

<strong>Putting frames in your webpage</strong>

by theeye



<hr />
<strong>What is a Frame? </strong>

Frames allows a single browser window to be divided into multiple section, each with independent HTML page loaded inside it and can interact with each other. It's like having a webpage inside another webpage with other webpage in it! A lot of web page designers use this because it adds efficiency in viewing the webpage and that it also looks cool. Here is one example:
<table width="580" border="0" bgcolor="#FFFFCC]
<tr>
<td>&lt;html&gt;

&lt;head&gt;&lt;title&gt;How to create Frames&lt;/title&gt;&lt;/head&gt;
&lt;frameset cols="25%,75%"&gt;
&lt;frameset&gt;

&lt;frameset src="another html file.html" name="index bar"&gt;

&lt;frameset&gt;
&lt;frameset&gt;

&lt;frame src="main.html" name="main"&gt;

&lt;/frameset&gt;
&lt;frameset&gt;

&lt;noframes&gt;

This page requires a frames-capable browser please get one!

&lt;/noframes&gt;

&lt;/html&gt;</td>
</tr>
</table>
&nbsp;
You might ask me where the heck is the body tag?!?! In here, the body of the page is replaced with frameset and an additional noframes tag. The frames page mostly did not contain any content. This is because all the content and settings are positioned on the separate HTML pages the you loaded within this section, specifically, on the <strong>&lt;frameset src="filename.html"&gt;</strong> tag.
<strong>The FRAMESET Tag </strong>

The frameset tag is used for multiple times throughout a single section or frames page. This defines the characteristics of the frames.
  • In the first frameset tag, it defines the number of separate frame columns within the browser window.
  • The second defines what would be the width of each window.
  • The next set of frameset tags, define how many frame rows will be in the browser window.
  • The next defines each frame's height.
You might also wonder what the noframes tags is for. Well, it identifies what browser that is not frames-enabled to see. The contents in this would be considered as a normal HTML page because frameset tags are ignored by a non-frames browser. And this is how you do it.

Type first the<strong> &lt;noframes&gt; </strong>tag, the the <strong>&lt;body&gt;</strong> tag. Then type what you want to write inside, and ending it, type the <strong>&lt;/body&gt;</strong> tag, followed by the <strong>&lt;/noframes&gt;</strong> tag to close it.
<strong>Setting the COLUMNS and ROWS </strong>

When we define columns and rows in a frame, we start it with a <strong>&lt;frameset&gt;</strong> tag and then close it with a <strong>&lt;/frameset&gt;</strong> tag.

There are three kinds of numbers that we can use in setting the size of the column or the row.
a. x%(x is a number between 1 to 100)- it determines the width of the column by a percent available in the browser window. The same thing with the row, only that it determines the height of the available browser window in percent.
b. x(defines any number)- tells a defined pixel value in width(if you use it in making a column) or height(if you use it in making a row).
c. *- tells the browser to use the all the available space left.
To make it more clear, here are the examples:
for columns:
1. <strong>&lt;frameset cols="45%,55%&gt;</strong>- means that the first column is 45% of the window and the second column is 55% of the browser window.
2. <strong>&lt;frameset cols="180,*"&gt;</strong> means the browser will use 120 pixels of width for the first column and the remaining space left for the second column.
For the rows, it's almost the same with the columns, only that you use the <strong>&lt;frameset rows="size of first row, size of second row, size of third row, size of so on and so on row"&gt;</strong> tag.
ADITTIONAL ATTRIBUTES OF THE FRAME TAG
  • noresize- commands the browser that the frame can not be resize by the user. If you don't use this tag, the user will be able to resize your frame.
  • scrolling="yes"- puts a scroll bar in the frame scrolling="no- doesn't place a scroll bar in the frame scrolling="auto"- this makes the browser determine if you need a scroll bar.
  • name="name of the frame"- this one is optional. It assigns a name to the frame. If you don't use this, the browser will not name the frame. It is also often targeted by links in other documents.
example:
<table width="580" border="0" bgcolor="#FFFFCC]
<tr>
<td height="26]&lt;frame src="filename.html" scrolling="yes" noresize name="main"&gt;</td>
</tr>
</table>
&nbsp;
<hr />
Written by <strong>theeye</strong> (13 March 2005)

<strong>theeye</strong> is a Member of <strong>Knowledge Bank Tutorial Writers</strong>
<p class="style1].:edited by purefreak
</body>
</html>


This article was imported from the CyberArmy University site. (original author: theeye)


There are no replies to this post yet.



Guest:
Subject:
Message:
Signature:
Optional Image Link:
http://

CyberArmy::Forum v0.6
Generated In 0.01434 seconds


About Us | Privacy Policy | Mission Statement | Help