HTML FRAMES (1)
HTML FRAMES (1)
Disadvantages of frames
Frames are obsolete in HTML5 as most devices with small screens are not compatible with frames
2. What’s a frameset?
A collection of frames in the browser window is called as a frameset. To use frames on a web page
instead of <body> we use <frameset>. <frameset> tag defines how to divide the window into
multiple frames. FRAMESET is a master HTML document that defines the arrangement of the
frames on the page. FRAMESET is responsible for allotting space for each frame in it.
3. Attributes of <FRAMESET>
ROWS- Specifies that the window is to be split into horizontal frames with the width of
frames separated by commas
<frameset rows="50% , 50%">
COLS- specifies that the window is to be split into vertical frames with the width of each
frame separated by commas
<frameset cols="50% , *">
Width could be in pixels, % or it could be given in * (asterisk represents the remaining
available space)
Border – specifies the thickness in pixels. Default is 5px
<frameset border=6> (specifies that all frames which are part of this frameset will be having
a border of 6px)
Frameborder – specifies whether the border of all frames in the frameset should be visible
or not.
Page 1 of 5
4. What is the use of <FRAME> tag?
A frame defines a rectangular region with in the frameset. Each frames can display separate
documents, including scrollbars and borders.
5. Attributes of <FRAME>
src – specifies the URL of the document to be displayed in the frame. If src is not given, an
empty frame will be displayed
<frame src="trial1.html">
name - specifies the name of the frame. Its required for linking between frames. Frame name
must start with an alpha numeric character or an underscore
<frame name="frm1">
Frameborder – specifies whether the border of the frameset should be visible or not.
It takes Yes or No value
Marginheight- specifies the distance between the top and bottom edges of the frame and the
frame contents
Marginwidth- specifies the distance between the left and right edges of the frame and the
frame contents
Scrolling – specifies the status of the scrollbars. It can take values YES, NO or AUTO
NORESIZE- It prohibits users from resizing a frame. Without this attribute the visitors can
drag and resize the frames
VERTICAL FRAMES
FRAME A FRAME B
Page 2 of 5
HORIZONTAL FRAMES
FRAME A
FRAME B
EQUISIZED FRAMES
FRAME A FRAME B
FRAME C FRAME D
FRAME B FRAME C
Page 3 of 5
7. What is the purpose of <NOFRAMES> tag?
If a browser does not support frames the message between the <NOFRAMES> tags will be
displayed. The browsers supporting FRAMES ignore the message given in <NOFRAMES>
<HTML>
<FRAMESET COLS=" 50%, * ">
<FRAME SRC=" home.html ">
<FRAME SRC=" table.html ">
</FRAMESET>
<NOFRAMES>
<P> Your browser doesn’t support frames </p>
<A href=" home1.html "> click here to see the page without frames </A>
</NOFRAMES>
<A href = "home.html" TARGET="WIN"> (home.html will be opened in the window WIN, so it
will overwrite the content in that fame to display home.html)
Page 4 of 5
10. Write html code to create the following frame set
D.html
A.html
C.html
B.html E.html
<html>
<head> <title> frame1 </title> </head>
<frameset cols="*,*,*">
<frameset rows="50%, 50 %">
<frame src="A.html">
<frame src="B.html">
</frameset>
<frame src="C.html">
<frameset rows="50%, 50 %">
<frame src="D.html">
<frame src="E.html">
</frameset>
<html>
Page 5 of 5