FRAMES
FRAMES
INTRODUCTION TO FRAMES
WHAT is a frame?
• Frames divide the browser window into parts, each of which appears as a separate HTML document.
• Frames work very much like tables. They are used to divide the screen into two or more web pages,
and
• simultaneously display their contents in a single browser window.
• You can display more than one HTML documents in the same browser window. Each HTML document
is called a FRAME. Each frame is independent of each other while still being displayed on the same
page.
• Each region is scrollable. Each frame has its own scrollbar which can be used to scroll through the
pages.
• You can present information in a more flexible and useful manner.
• A frame can be resized on screen by the user. Resizing can also be disabled by the author, ensuring a
constant frame size.
• You can create a table of contents which can contain links that, when clicked, can display the results on
an adjoining frame.
• You can use frames to allow queries or questions to be posed and answered on the same page with
one frame containing the query or questionnaire and the other presenting the results.
SYNTAX: <frameset> </frameset>
FRAMESET – tag to create a frame
Attributes of Frameset tag
✓ Rows- defines the number and size of horizontal frames.
✓ Columns - defines the number and size of vertical frames.
✓ Border – specifies the space between frames
✓ Bordercolor – customizes color of lines separating frames.
✓ Frameborder – turns border between frames on and off. (0 or no borders, 1 or yes enables
border.
Example:
<frameset rows =“50%,50%”>
<frame src=“top.html”>
<frame src=“bottom.html”>
</frameset>
Save as framerows.html
The rows attribute works similarly with Cols attribute. Horizontal frames are created from top to
bottom. Like the COLS attribute, specify the height of frames using percentage values.
HTML Iframes
Just like frames, inline frames display another Webpage but inline frames are not placed within
<frameset></frameset> but instead in <body></body>, yes, within the body of the Web page itself.
Inline frames are embedded on the Web page-A Webpage within a Webpage.
Inline frames are defined by the container tag <iframe></iframe>
An HTML iframe is used to display a web page within a web page.
The HTML <iframe> tag specifies an inline frame.
An inline frame is used to embed another document within the current HTML document.
HTML Iframe Syntax
<iframe src="url" title="description"></iframe>