0% found this document useful (0 votes)
11 views8 pages

HTML Frameset and Frame Usage Guide

HTML frames allow division of a browser window into multiple sections, each loading separate HTML documents, organized in a frameset. The <frameset> tag replaces the <body> tag to define frame layout, with attributes for rows and columns. The <frame> tag includes attributes like src for the document source, name for frame identification, and scrolling for scrollbar control.

Uploaded by

23eg105d62
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

HTML Frameset and Frame Usage Guide

HTML frames allow division of a browser window into multiple sections, each loading separate HTML documents, organized in a frameset. The <frameset> tag replaces the <body> tag to define frame layout, with attributes for rows and columns. The <frame> tag includes attributes like src for the document source, name for frame identification, and scrolling for scrollbar control.

Uploaded by

23eg105d62
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Frameset

Frame
HTML frames are used to divide your browser window into multiple sections
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

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
cols attribute defines vertical frames
Each frame is indicated by <frame>
<!DOCTYPE html>
Example
<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>Your browser does not support frames.</body>


</noframes>

</frameset>

</html>
<!DOCTYPE html>
Example
<html>
<head> <title>HTML Frames</title> </head>
<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" />

<noframes> <body>Your browser does not support frames.</body>


</noframes>

</frameset> </html>
The <frame> Tag Attributes
[Link] Attribute & Description
src

This attribute is used to give the file name that


1 should be loaded in the frame. Its value can be
any URL. For example, src =
"/html/top_frame.htm" will load an HTML file
available in html directory.
name
This attribute allows you to give a name to a frame.
It is used to indicate which frame a document
2
should be loaded into..

scrolling
This attribute controls the appearance of the
scrollbars that appear on the frame. This takes
3
values either "yes", "no" or "auto". For example
scrolling = "no" means it should not have scroll bars.
Example
<!DOCTYPE html>
<html> <head> <title>HTML Target Frames</title> </head>
<frameset cols = "200, *">
<frame src = "/html/[Link]" name = "menu_page" />
<frame src = "/html/[Link]" name = "main_page" />

<noframes> <body>Your browser does not support frames.</body>

</noframes>

</frameset>

</html>
[Link]
<!DOCTYPE html>
<html>
<body bgcolor = "#4a7d49">
<a href = "[Link] target = "main_page">Google</a>
<br /> <br />

<a href = "[Link] target = "main_page">Microsoft</a>

<br /> <br />

<a href = "[Link] target = "main_page">BBC News</a> </body>


</html>
[Link]
<!DOCTYPE html>
<html> <body bgcolor = "#b5dcb3">
<h3>This is main page and content from any link will be displayed here.</h3>
<p>So now click any link and see the result.</p>
</body>

</html>

You might also like