HTML 03
- chathu hewage
- Feb 10, 2021
- 1 min read
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 frame set. The window is divided into frames in a similar way the tables are organized: into rows and columns.
Disadvantages of Frames
There are few drawbacks with using frames, so it's never recommended to use frames in your web pages
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.
The <frameset> Tag Attributes
The <frame> Tag Attributes
Example 01
Following is the example to create three horizontal frames-
<html>
<head><title>Frame</title>
</head>
<frameset rows="20%,60%,20%">
<frame src="Frame1.html">
<frame src="Frame2.html">
<frame src="Frame3.html">
</html>
Output

Example 02.
<html>
<head><title>Frame</title>
</head>
<frameset cols="20%,80%">
<frame src="Frame1.html">
<frame src="Frame2.html">
</frameset>
</html>
Output

Example 03
<html>
<head><title>Frame</title>
</head>
<frameset rows="40%,60%">
<frame src="pageA.html">
<frameset cols="10%,50%">
<frame src="pageB.html">
<frame src="pageC.html">
</frameset>
</frameset>
</html>
Output

Try to do these two questions.


Referencess:
Tutorial Created by Vinavi Sathsarani
Comments