HTML FRAMES
HTML FRAMES
HTML <frame> tag define the particular area within an HTML file where
another HTML web page can be displayed.
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
Display Block
Usage Frames
Example 1
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>
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