You are on page 1of 3

HTML FRAME AND FRAMESET

THEORY & CONCEPT:

a. HTML Frameset

The <frameset> tag is not supported in HTML5.

The <frameset> element holds one or more <frame> elements.

The <frameset> element specifies HOW MANY columns or rows there will be in the
frameset, and HOW MUCH percentage/pixels of space will occupy each of them

Display a separate document in each rectangle

Each rectangle is called frame.

Allows user to view more than 1 web page in the same browser at the same time.

b. HTML Frames

The <frame> tag is not supported in HTML5.

The <frame> tag defines one particular window (frame) within a <frameset>.

Each <frame> in a <frameset> can have different attributes, such as border, scrolling,
the ability to resize, etc.

HTML FRAMES

25

c. Creating Frame

Tags used <frameset>.

The tag defines the general layout of the web page that uses frames and how many
columns or rows will be in the frame.

The syntax:

<HTML>
<head>
</head>
<frameset rows="20 %,*">
<frame src="header.htm" name=title>
<frameset cols="30 %,*">
<frame src="menu.htm" name=menu>
<frame src="content.htm" name=content>
</frameset>
</HTML>

The above codes contain 3 frames.

* symbol allocates the remaining space to the second row and cols.

Name is the frame name and it is important for linking reference.

Src is the path address, file that wants to be display in the frame.

d. Hiding and displaying scroll bar

By default a scroll bar is displayed when the contents of the page not fit the frame.

This can be override by setting the scrolling attribute.

The syntax: <frame src = header.html scrolling = no>

e. Controlling Frame Resizing

To prevent users from resizing the frame border:

<frame src = header.html scrolling = no noresize>

HTML FRAMES

26

f. Link Targetting

To open the hyperlink document in the same frame, user has to set the frame
target.

The target is the frame name and must be set at the hyperlink tag.

Example: <a href= menu1.html target = menu>

Also can use target:


self - Opens in same frame
_top and _parent - Opens over the top of the frames page, removing the
frames
_blank - A new window (not necessarily for frames pages).

f. Inline frame

Inline or floating frames are ones which appear on a page, much like an image or
a table would.

This allows you to open completely separate pages in the middle of the pages

The syntax:
<iframe src="order.html" width="80%" height="110"> </iframe>

HTML FRAMES

27

You might also like