0% found this document useful (0 votes)
5 views5 pages

HTML FRAMES

The HTML <frame> tag, used to display multiple web pages within a single HTML document, is not supported in HTML5 and should be replaced with <iframe> or <div> with CSS. It is used in conjunction with the <frameset> tag to create vertical or horizontal frames, and has various attributes such as cols, rows, and src to define frame properties. While it allows viewing multiple documents simultaneously, its disadvantages include complications in website production and issues with bookmarking and browser navigation.

Uploaded by

aicict2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

HTML FRAMES

The HTML <frame> tag, used to display multiple web pages within a single HTML document, is not supported in HTML5 and should be replaced with <iframe> or <div> with CSS. It is used in conjunction with the <frameset> tag to create vertical or horizontal frames, and has various attributes such as cols, rows, and src to define frame properties. While it allows viewing multiple documents simultaneously, its disadvantages include complications in website production and issues with bookmarking and browser navigation.

Uploaded by

aicict2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

HTML <FRAME> TAG (NOT SUPPORTED IN HTML5)

HTML <frame> tag define the particular area within an HTML file where
another HTML web page can be displayed.

A <frame> tag is used with <frameset>, and it divides a webpage into


multiple sections or frames, and each frame can contain different web pages.

Note: Do not use HTML <frame> tag as it is not supported in HTML5, instead you can use
<iframe> or <div> with CSS to achieve similar effects in HTML.

Syntax

1. < frame src = "URL" >

Following are some specifications about the HTML <frame> tag

Display Block

Start tag/End tag Start tag(required), End tag(forbidden)

Usage Frames

Example 1

Create Vertical frames:

1. <!DOCTYPE html>
2. <html>
3. <head>
4. <title>Frame tag</title>
5. </head>
6. <frameset cols="25%,50%,25%">
7. <frame src="frame1.html" >
8. <frame src="frame2.html">
9. <frame src="frame3.html">
10. </frameset>
11. </html>

1|Page
To define the horizontal frames use row attribute of frame tag in
HTML document and to define the vertical frames use col
attribute of frame tag in HTML document. Example:

<!DOCTYPE html>
<html>
<head>
<title>Example of HTML Frames using row attribute</title>
</head>

<frameset rows = "20%, 60%, 20%">


<frame name = "top" src =
"C:/Users/dharam/Desktop/attr1.png" />
<frame name = "main" src =
"C:/Users/dharam/Desktop/gradient3.png" />
<frame name = "bottom" src =
"C:/Users/dharam/Desktop/col_last.png" />
<noframes>
<body>The browser you are working does
not support frames.</body>
</noframes>
</frameset>
</html>

Attributes of Frameset tag:


 cols: The cols attribute is used to create vertical frames in
web browser. This attribute is basically used to define the no
of columns and its size inside the frameset tag. The size or
width of the column is set in the frameset in the following
ways:
 Use absolute value in pixel Example:
<frameset cols = "300, 400, 300">
 Use percentage value Example:
<frameset cols = "30%, 40%, 30%">
 Use wild card values: Example:
<frameset cols = "30%, *, 30%">
In the above example * will take the remaining
percentage for creating vertical frame.
 rows: The rows attribute is used to create horizontal frames
in web browser. This attribute is used to define no of rows and
2|Page
its size inside the frameset tag. The size of rows or height of
each row use the following ways:
 Use absolute value in pixel Example:
<frameset rows = "300, 400, 300">
 Use percentage value Example:
<frameset rows = "30%, 40%, 30%">
 Use wild card values Example:
<frameset rows = "30%, *, 30%">
In the above example * will take the remaining
percentage for creating horizontal frame.
 border: This attribute of frameset tag defines the width of
border of each frames in pixels. Zero value is used for no
border. Example:
<frameset border="4" frameset>
 frameborder: This attribute of frameset tag is used to
specify whether the three-dimensional border should be
displayed between the frames or not for this use two values 0
and 1, where 0 defines for no border and value 1 signifies for
yes there will be border.
 framespacing: This attribute of frameset tag is used to
specify the amount of spacing between the frames in a
frameset. This can take any integer value as an parameter
which basically denotes the value in pixel. Example:
 <framespacing="20">
 It means there will be 20 pixel spacing between the
frames
Attributes of Frame Tag:
 name: This attribute is used to give names to the
frame. It differentiate one frame from another. It is
also used to indicate which frame a document
should loaded into. Example:
 <frame name = "top" src =
"C:/Users/dharam/Desktop/attr1.png" />
 <frame name = "main" src =
"C:/Users/dharam/Desktop/gradient3.png" />
 <frame name = "bottom" src =
"C:/Users/dharam/Desktop/col_last.png" />
Here we use three frames with names as left
center and right.

3|Page
 src: This attribute in frame tag is basically used to
define the source file that should be loaded into
the frame.The value of src can be any
url. Example:
<frame name = "left" src = "/html/left.htm" />
In the above example name of frame is left and
source file will be loaded from “/html/left.htm” in
frame.
 marginwidth: This attribute in frame tag is used
to specify width of the spaces in pixels between
the border and contents of left and right
frame. Example:
 <frame marginwidth="20">
 marginheight: This attribute in frame tag is used
to specify height of the spaces in pixels between
the border and contents of top and bottom
frame. Example:
 <frame marginheight="20">
 scrollbar: To control the appearance of scroll bar
in frame use scrollbar attribute in frame tag. This is
basically used to control the appearance of
scrollbar. The value of this attribute can be yes, no,
auto. Where the value no denotes there will be no
appearance of scroll bar. Example:
 <frame scrollbar="no">
Advantages:
 It allows the user to view multiple documents
within a single Web page.
 It load pages from different servers in a single
frameset.
 The older browsers that do not support frames can
be addressed using the tag.
Disadvantages: Due to some of its disadvantage it is
rarely used in web browser.
 Frames can make the production of website
complicated.
 A user is unable to bookmark any of the Web
pages viewed within a frame.
 The browser’s back button might not work as the
user hopes.

4|Page
 The use of too many frames can put a high
workload on the server.
 Many old web browser doesn’t support frames.
Note: This tag is not supported in HTML5. Supported
Browser: The browser supported by <frame> tag are
listed below:
 Google Chrome
 Internet Explorer
 Firefox
 Opera
 Safari

5|Page

You might also like