INTRODUCTION TO WEB DESIGN
DCIS1204
SEMISTER TWO
YEAR ONE
HTML frames
HTML frames are used to divide your browser window into multiple sections where each section can load a
separate HTML document. A collection of frames in the browser window is known as a frameset. The window is
divided into frames in a similar way the tables are organized: into rows and columns.
Disadvantages of Frames
Some smaller devices cannot cope with frames often because their screen is not big enough to be divided up.
Sometimes your page will be displayed differently on different computers due to different screen resolution.
The browser's back button might not work as the user hopes.
There are still few browsers that do not support frame technology.
Creating Frames
To use frames on a page we use <frameset> tag instead of <body> tag. The <frameset> tag defines, how to divide
the window into frames. The rows attribute of <frameset> tag defines horizontal frames and cols attribute defines
vertical frames. Each frame is indicated by <frame> tag and it defines which HTML document shall open into the
frame.
HTML frames
Syntax:< frame src = "URL" >
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.
<!DOCTYPE html>
<html>
<body>
<frameset rows = "10%,80%,10%">
<frame name = "top" src = "/html/top_frame.html" />
<frame name = "main" src = "/html/main_frame.html" />
<frame name = "bottom" src = "/html/bottom_frame.htm" />
<noframes>
<body>Your browser does not support frames.</body>
</noframes>
</frameset>
</body>
</html>
HTML frames
What to Use Instead?
Since the <frame> tag depricated you can use the <iframe> tag to embed another document within
the current HTML document:
Browser Support for Frames
If a user is using any old browser or any browser, which does not support frames then <noframes>
element should be displayed to the user.
So you must place a <body> element inside the <noframes> element because the <frameset>
element is supposed to replace the <body> element, but if a browser does not understand
<frameset> element then it should understand what is inside the <body> element which is
contained in a <noframes> element.
Following are important attributes of the <frameset> tag
HTML frames
HTML frames