Frames:
Frames are a one of the html feature. Frames are introduced by Netscape
communication it’s allows to divided into a browser window in several
parts. Each part called container. Frames have the following characteristics.
-Each frame is given a name and each frame will be targeted
by an html document.
-Each frame work it’s self.
A group of frames in a single browser window is called a
frameset.
A set of frames is defined by using the <framset>
(frame set tag). Frame set has two attributes.
1. Rows frame
2. Columns frame
Rows frame:
The rows
attribute of <frameset> tag defines horizontal frames.
Example: <frameset
rows=”40%,60%”>
Columns frame: (cols)
The cols attribute
of <frameset> tag defines vertical frames.
Example: <frameset cols=”20%,80%”>
The size of each frame in rows frame or columns frame can be
defined there values by pixels or percentages
Using pixels:
<frameset cols=”200,150”>
Here the first frame contains 200 pixels and second frame
contains 150 pixels.
Using percentages
<frameset cols=”20%,80%”>
Here the first frame contains 20 percent of size in that
webpage and second frame contains 80 percent on that web page.
Frame tag (<frame>):
The frame set has the following attributes
1. Source
2. Name
3. Margin
4. Scrolling bar
Source:
The source
attribute gives the location html document.
Name:
A frame is given a
name to identify which specified the target of html document. The frame begins with an alphabetic letter.
Margin:
By using this attribute we can give the margin width and
margin height to the frame border and its contents. The values are given in pixels.
Example:
<frame name=”first”
src=”fruits.html” marginwidth=”5” marginheight=”5”>
Scrolling bar:
The scrolling
attribute is used to describe whether the frame should have scroll bar or not.
Example:
<frame name=”first” src=”birds.html” scrolling=”yes”>
Nested frames:
It is possible to devoid
a frame into again and again.
Example:
<frameset cols=”70%,30%”>
<frameset rows=”80%,20%”>
-----------------------------------------------------------------------------------------------------------------
Program 1: we are saving this file name as fruits.html
<html>
<head><title>Fruits</title>
</head>
<body>
<ol>
<li>Apple</li>
<li>Mango</li>
<li>Banana</li>
</ol>
</body>
</html>
Program 2: we are saving this file name as birds.html
<html>
<head>
<title>Birds</title>
</head>
<body>
<ul>
<li>Peacock</li>
<li>Pegion</li>
<li>Parrot</li>
</ul>
</body>
</html>
Program for Frames:
<html>
<head>
<title>Frameset</title>
</head>
<frameset cols="20%,70%">
<frame
src="fruits.html" name="First">
<frame
src="birds.html" name="second">
</frameset>
</html>
No comments:
Post a Comment