0% found this document useful (0 votes)
2 views

HTML Frames

HTML frames allow the division of a browser window into multiple sections, each capable of loading separate HTML documents, organized in a frameset. However, they have disadvantages such as compatibility issues with smaller devices, inconsistent display across different resolutions, and potential issues with the browser's back button. Frames are created using the <frameset> tag, which can define horizontal or vertical frames, and the target attribute can specify where to open linked documents.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

HTML Frames

HTML frames allow the division of a browser window into multiple sections, each capable of loading separate HTML documents, organized in a frameset. However, they have disadvantages such as compatibility issues with smaller devices, inconsistent display across different resolutions, and potential issues with the browser's back button. Frames are created using the <frameset> tag, which can define horizontal or vertical frames, and the target attribute can specify where to open linked documents.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

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:
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.
Creating Frames
To use frames on a page we use tag instead of tag. The tag defines, how to
divide the window into frames. The rows attribute of tag defines horizontal
frames and cols attribute defines vertical frames. Each frame is indicated by
tag and it defines which HTML document shall open into the frame.
Example:-For Creating Horizontal frames.
<html>
<head>
<title>HTML Frames</title>
</head>
<frameset rows="10%,80%,10%">
<frame name="top" src="/html/top_frame.htm" />
<frame name="main" src="/html/main_frame.htm" />
<frame name="bottom" src="/html/bottom_frame.htm" />
<noframes>
<body>
our browser does not support frames.
</body>
</noframes>
</frameset>
</html>
Ex2:-Creating Vertical frames

<frameset cols="25%,50%,25%">
<frame name="left" src="/html/top_frame.htm" />
<frame name="center" src="/html/main_frame.htm" />
<frame name="right" src="/html/bottom_frame.htm" />
</frameset>

Mixed Frame:-

<frameset rows="50%,50%">
<frame src="frame_a.htm">
<frameset cols="25%,75%">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
Frame's name and target attributes:-
One of the most popular uses of frames is to place navigation bars in one
frame and then load main pages into a separate frame.

The target attribute specifies where to open the linked document:

A target="framename" attribute value specifies that the linked page or form


response will be opened in the named frame. The targetattribute can also take one of the
following values:

You might also like