Module-10-Creating-HTML-Frames-Copy
Module-10-Creating-HTML-Frames-Copy
Creating HTML
Frames
FRAME
A framed page is made up of multiple HTML pages.
One HTML document describes how to break up the
single browser window into multiple windowpanes.
Each windowpane is filled with an HTML document.
It is used to divide your browser windows into
multiple sections where each section can load a
separate HTML document. A collection of frames in
the browser is known as a frameset. The window is
divided into frames in a similar way the tables are
organize into rows and columns
FRAME PAGE ARCHITECTURE
The <frameset>
A <frameset>
describes the amount of
element is placed in
screen real estate given
the html document
to each
before the <body>
windowpane by dividing
element.
the screen into ROWS or
COLS.
The <frameset> will then contain <frame> elements, one per division
of the
browser window.
Frameset Container
COLS: Determines the size and number of rectangular columns within a
<frameset>.
They are set from left to right of the display area.
<frameset rows="50%,50%">
<frame src="iframe1.html">
<frame src="iframe2.html">
</frameset>
Frames Attributes
target.
Sample syntax for frame target:
<frameset cols="20%,80%">
<frme src="menu.htm" NORESIZE>
<frame scr="home.htm" name="content" NORESIZE>
<frame src="content.htm" name="content" NORESIZE>
</frameset>
For the 2nd page we name it Menu.
As you can see in the Menu page, we use <ul> or unordered list to create a
selection between our Home and Content pages. We use also <li> or list item
and <a> tag for the hyperlink, which is used to link from one page to another,
<href> attribute to indicate the link’s destination. Lastly the <target> attribute
use to show the page that you want to show in the bigger frame. The Home and
Content pages is just normal HTML documents that we do, where you can put
any information that you want.
IFRAMES
An iframe is used to display a web page within a web page. An HTML
iframe is defined with the <iframe> tag:
Example:
<iframe src="URL"></iframe>
<body bgcolor="lightblue";>
<center>
<h2>Iframe - Target for a Link</h2>
<iframe height="320px" width= “300%"
src="iframe1.html" name="iframe">
</iframe>
<p><a href="iframe2.html"
target="iframe">click me pliss! </a></p>
<p>When the target of a link matches the
name of an iframe, the link will open in
the iframe. </p>
</center>
</body>
For other pages it is just the same syntax that we use, we name it
iframe1.html and iframe2.html
• Use the height and width attributes to specify the size of the iframe.
• The attribute values are specified in pixels by default, but they can
also be in percent (like "80%").