frameset and frame tag - Part 1


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
noresize = noresize

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.

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:
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<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"/>
<frame src="footer.html" name="footer"/>

<body bgcolor="orange">

<body bgcolor="gray">

<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/>


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