HTML Frames
HTML Frames
Definition of frame:
HTML frames are used to divide browser window into multiple sections where each section can
load a separate HTML page. A collection of frames in the browser window is known as a
frameset. To use frames on a page we use <frameset> tag instead of <body> tag. Each frame
is indicated by <frame> tag.
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 src attribute in <frame>
tag is used to identify the address of webpage that should be loaded inside each frame.
Example 1:Create one frame using <frameset>
<html>
<frameset >
<frame src="frame1.html" >
</frameset>
</html>
Exampe2: Create three Vertical frames:
<html>
<frameset cols="25%,50%,25%">
<frame src="frame1.html" >
<frame src="frame2.html">
<frame src="frame3.html">
</frameset>
</html>
Exampe3: Create two Horizontal frames:
<html>
<frameset rows="50%,50%">
<frame name="top" src="frame1.html" >
<frame name="bottom" src="frame3.html">
</frameset>
</html>