frameset and frame tag - Part 1

Notes:

HTML frame set tag and HTML frame tag:

we use frameset tag to divide browser window into different frames.
Each of which can be able to show different web page or document.
Each frame, works like a separate browser window.
To use frameset tag, body tag should not be used.
That is if we use body tag we can't use frameset tag vice versa.
Frame set helps to utilize the bandwidth in efficient manner.
We can divide constant and variable layouts in different frames.

frameset tag is a paired tag.
in place of opening body tag we write opening frameset tag
in place of closing body tag we write closing frameset tag
attributes:
noresize = noresize
frameborder=0
scrolling=no

rows and cols attribute takes comma separated values.
values can be either in percentage or pixels.

frame tag is a child tag of frameset tag.
frame tag is an unpaired tag
frame tag has src attribute, to which we give file name.
name

frameset tag and table tag never be used for creating layout of web pages any more. Because layouts designed using these tags will not get render properly on small screen devices. Table and framesets are not going to help in creating flexible and resolution independent layouts. Hence we use div tag for creating layouts in modern web designing.

Example Code:
default.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Home</title>
</head>
<frameset rows="15%,*,25%" frameborder="0">
<frame src="header.html" name="header"/>
<frameset cols="20%,*">
<frame src="nav.html" name="nav"/>
<frame src="home.html" name="content"/>
</frameset>
<frame src="footer.html" name="footer"/>
</frameset>
</html>

header.html
<html>
<head>
<title>Header</title>
</head>
<body bgcolor="orange">
Header
</body>
</html>

footer.html
<html>
<head>
<title>footer</title>
</head>
<body bgcolor="gray">
Footer
</body>
</html>

nav.html
<html>
<head>
<title>Nav</title>
</head>
<body bgcolor="cyan">
<a href="home.html" target="content">Home</a><br/>
<a href="skills.html" target="content">skills</a><br/>
<a href="about.html" target="content">About</a><br/>
</body>
</html>

home.html
<html>
<head>
<title>Content</title>
</head>
<body>
Welcome
</body>
</html>

Interview Questions:

1. HTML frame tag is the child tag of ________ HTML tag
a. iframe tag
b. selection tag
c. framset tag
d. imagemap tag
Answer: c