HTML Frames
HTML Frames
HTML frames are used to divide your browser window into multiple sections
where each section can load a separate HTML document independently. 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.
HTML <frame> Tag
HTML <frame> tag is used to divide web browser windows into multiple sections,
each capable of loading content independently. This is achieved using a collection
of frames within a frameset tag.
Note: The <frame> tag is deprecated in HTML 5.
Syntax
<frameset rows="50%,50%">
<frame name="top" src="link/to/frame1" />
<frame name="bottom" src="link/to/frame2" />
</frameset>
Where the rows attribute of frameset defines the division of the window into
horizontal sections. In this case, the window is divided into two rows, each taking
up 50% of the available height.
Following is the example to create three horizontal frames. If your browser does
not support frames, then body element is displayed.
Disadvantages of Frames
There are few drawbacks with using frames, so it's never recommended to use
frames in your webpages.
• 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.