Lecture 7 Frames
Lecture 7 Frames
Introduction
• Frames allow you to divide the page into several
rectangular areas and to display a separate
document in each rectangle.
• Each of those rectangles is called a "frame".
• Frames are very popular because they are one of
the few ways to keep part of the page stationary
while other parts change.
• Frames are also one of the most controversial
uses of HTML, because of the way the frames
concept was designed, and because many web
framed web sites are poorly implemented.
• Frames can divide the screen into separate
windows.
• Frameset commands placed outside the body
• Each of these windows can contain an HTML
document.
• A file that specifies how the screen is divided into
frames is called a frameset.
• If you want to make a homepage that uses frames
you should:
– make an HTML document with the frameset
– make the normal HTML documents that should be
loaded into each of these frames.
• When a frameset page is loaded, the browser
automatically loads each of the pages associated
with the frames.
Creating a frameset
<html>
<head>
<title>My Frames Page</title>
</head>
<frameset cols="120,*">
<frame src="menupage.htm" name="menu">
<frameset rows="*,50">
<frame src="welcomepage.htm" name="main">
<frame src="bottombanner.htm" name="bottom">
</frameset>
</frameset>
</html>
Making borders invisible
<frameset
cols="120,*" frameborder="0"
border="0" framespacing="0">
Making frames not resizable
<frameset cols="120,*"
frameborder="0" border="0"
framespacing="0">
<frame src="menu.htm"
name="menu" noresize>
<frame src="frontf.htm"
name="main" noresize>
</frameset>
Add scrollbars
<frameset cols="120,*"
frameborder="0" border="0"
framespacing="0">
<frame src="menu.htm" name="menu"
noresize scrolling=no>
<frame src="frontf.htm"
name="main"
noresize scrolling=auto>
</frameset>