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

Inserting Frames

The document explains HTML frames, which allow a browser window to be divided into multiple sections, each loading a separate HTML document. It discusses the advantages and disadvantages of using frames, such as the ability to view multiple documents simultaneously and complications with bookmarking and navigation. Additionally, it provides examples of how to create framesets using the <frameset> and <frame> tags, including code snippets for horizontal and mixed framesets.

Uploaded by

zeninmki1216
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Inserting Frames

The document explains HTML frames, which allow a browser window to be divided into multiple sections, each loading a separate HTML document. It discusses the advantages and disadvantages of using frames, such as the ability to view multiple documents simultaneously and complications with bookmarking and navigation. Additionally, it provides examples of how to create framesets using the <frameset> and <frame> tags, including code snippets for horizontal and mixed framesets.

Uploaded by

zeninmki1216
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Lesson 14 INSERTING FRAMES IN THE WEB

What is Frame?
A frame is a basic shape or structure, especially one that outlines or surrounds a
door or window. When frame is a noun, it is usually some kind of enclosure or outline that
is also a physical support — like the frame around a window, a bed frame, or a
picture frame.

What is frame in HTML?


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.

The Basic Idea behind Frames


• Use the frameset element in place of the body element in an HTML document.
• Use the frame element to create frames for the content of the web page.
• Use the src attribute to identify the resource that should be loaded inside each frame.
• Create a different file with the contents for each frame.

Advantages and disadvantages of frames


The advantages of HTML frames include:
• The main advantage of frames is that it allows the user to view multiple documents within a
single Web page.
• It is possible to load pages from different servers in a single frameset.
• The concern that older browsers do not support frames can be addressed using the <noframe>
tag. This tag provides a section in an HTML document to include alternative content for
browsers without support for frames. However, it requires that the Web designer provide two
formats for one page.

The major disadvantages of using frames are:


• Bookmarks only mark the top level pages (the framesets themselves). A user is unable to
bookmark any of the Web pages viewed within a frame.
• Frames can make the production of a website complicated, although current software addresses
this problem.
• It is easy to create badly constructed websites using frames. The most common mistake is to
include a link that creates duplicate Web pages displayed within a frame.
• Search engines that reference a Web page only give the address of that specific document. This
means that search engines might link directly to a page that was intended to be displayed within
a frameset.
• Users have become so familiar with normal navigation using tables, the back button, and so
on, that navigating through a site that uses frames can be a problem.
• The use of too many frames can put a high workload on the server. A request for, say, ten files,
each 1 Kilobyte in size, requires a greater workload than a request for a single 10 Kilobyte file.
• Older browsers do not support frames.
HTML<frame> Tag
HTML Frames are used to divide the web browser window into multiple sections where each
section can be loaded separately. A frameset tag is the collection of frames in the browser window.
Creating Frames: Instead of using body tag, use frameset tag in HTML to use frames in web browser.

• The <frameset> tag defines a frameset.


• The <frameset> element holds one or more <frame> elements. Each <frame> element can
hold a
separate document.
• The <frameset> element specifies how many columns and rows there will be in a frameset,
and how much percentage/pixels of space will occupy each of them.

Attribute Value Description


Cols pixel, %, * Specifies the number and sizes of columns in a frameset.
Rows pixels, %,* Specifies the number and size of rows in a frameset.
Frameborder 1/0 1 : this value tells the user agent to draw a separator
between this frame and every adjoining frame.
0 : This value tells the user agent not to draw a separator
between this frame and every adjoining frame.
Marginwidth pixel - this attribute specifies the amount of space to be left
between the frames contents in its left and right margins.
- The value should be greater than zero.
Marginheight pixel - this attribute specifies the amount of space to be left
between the frame’s contents in its top and bottom
margins.
- The value should be greater than zero

How to make Horizontal Frameset with three different documents:


<html>
<frameset cols="25%,50%,25%" framespacing="2" frameborder="1">
<frame src="frens.html">
<frame src="script.html">
<frame src="family.html">
</frameset>
</html>
My frens All about me…. My Family

Simple

OUTPUT:
This is the output of the given codes above. It has 3 columns because as you can see there are
three frame tag in the program. The content of each frame is different from each other because in the
codes above it was declared that the file that will be displayed in frame number 1 is the file with a
filename “frens.html”. The second frame contains the file “script.html” and the third frames contains
the file “family.html”.
The size of each frame is also different from one another because it was declared in the tag
“frameset cols” that the first frame will be occupying the25% of the screen, the middle frame will be
50% of the screen and the last frame will be 25% to make it 100%.
How to make a frameset with three documents, and how to mix them in rows and columns?
<html>
<frameset ROWS="50%,50%">
<frame src="frens.html">
<FRAMESET COLS="25%, 75%">
<frame src="script.html">
<frame src="family.html">
</frameset>
</html>

OUPUT:
This is the output of the code given
above. There are two rows
(Horizontal) which was equally
Hello! divided because the declared size is
50% each. The first row contains the
file “frens.html” which contains the
word “Hello!”. The second row was
divided into two columns as you can
see in the tag “framest Cols”. The 2
column frame was divided into 2 a
25% frame and the 75% frame. They
have different content because its
frame was given files to display as
declared in the codes.

You might also like