Sei sulla pagina 1di 16

HTML Frames

Introduction and Usage


Important In HTML

Vey Useful

Several Web Pages Can be Displayed In Same Browser


Windows
Using Frames Several HTML Documents can be displayed
in the Same Web Browser Windows
Each HTML Document is called A Frame

Each Frame is Independent of Others

Frameset Element is Used For Framing


Frameset Element
An Element

Holds One or More Frames

It Defines Following:

1. How Many Columns Are In The Frameset

2. How Many Rows Are In The Frameset

3. How Many Pixel/Percentage Space Each Will


Occupy

<frameset> Is Opening Tag

</frameset> Is Closing Tag


Frameset Tag Attributes
cols:
-- Specifies Number and Size of Columns In Frameset
rows:
-- Specifies Number and Size of Rows In Frameset

Possible Values For rows,cols Attributes:

-- Pixel Defines Size In Pixels


-- Percentage Size Is In Percentage of the Available Space
-- * Rest of Available Space is Assigned
The FRAME Tag
<frameset> Tag Defines A Frameset

<frame> Tag is Used to define Frames

Defines A Particular Window inside a Frameset


Attributes:

-- frameborder Values(0,1) Specifies Whether to Display Border


or Not
-- marginheight Specifies Top and Bottom Margins of Frame
-- marginwidth Specifies Left and Right Margins of Frame
-- name Specifies Name of Frame
-- scrolling Values(yes,no,auto) Specifes Whether to Display
Scrolling Bars or Not
-- src Specifies the URL of the Web Page to be
Displayed in the Frame
Horizontal Frames
<html>
<head>
<title>Horizontal Frames</title>
</head>
<body>
<frameset rows=25%,75% />
<frame src=frame_a.html />
<frame src=frame_b.html />
</frameset>
</body>
</html>
Vertical Frames
<html>
<head>
<title>Vertical Frames</title>
</head>
<body>
<frameset cols=25%,75% />
<frame src=frame_a.html />
<frame src=frame_b.html />
</frameset>
</body>
</html>
Mixed Frameset 1
<html>
<head>
<title>Mixed Frameset</title>
</head>
<body>
<frameset cols="25%,75%">
<frame src="frame_a.htm" />
<frameset rows="20%,*" />
<frame src="frame_b.htm" />
<frame src="frame_c.htm" />
</frameset>
</frameset>
</body>
</html>
Mixed Frameset 2
<html>
<head>
<title>Mixed Frameset</title>
</head>
<body>
<frameset rows="25%,50%" >
<frame src="frame_a.html" />
<frameset cols="50%,50%" >
<frame src="frame_b.html" />
<frame src="frame_c.html" />
</frameset>
</frameset>
</body>
</html>
Comprehensive Example
Books.html

<html>
<body>
<h4> books </h4>
books list are as under
<pre>
1. visual basic <br>
2. Web programming <br>
3. High Level Programming <br>
4. Java
</pre>
</body>
<html>
Comprehensive Example
Contact.html

<html>
<body>
<h4> contact us </h4>
feel free to contact us regarding an query about net

web:www.uaf.edu.pk <br>
email:aaa@hotail.com <br>
mob:0092-0300-46574478

</body>
<html>
Comprehensive Example
Main.html

<html>
<body>
<h3> welcome to online book </h3>

online book shop provides you the facility to purchase published books
on a variety of topic. You can purchase the books on your credit card.

</body>
</html>
Comprehensive Example
menu.html

<html>
<body>
<a href="main.html" target="main"> main </a> <br>
<a href="books.html" target="main"> books </a> <br>
<a href="contact.html" target="main"> contact us </a>
</body>
Comprehensive Example
top.html

<html>
<body>
<h3>
Computer Science Department </h3> <br>
<h5>University of Agriculture Faisalabad </h5>
</body>
</html>
Comprehensive Example
frame.html:

<frameset rows="20%,80%">
<frame src="top.html" name="top">
<frameset cols="20%,80%">
<frame src="menu.html" name="left">
<frame src="main.html" name="main">
</frameset>
</frameset>
Preview

Potrebbero piacerti anche