HOME

HTML Basic
HTML HOME
HTML & WWW
HTML Introduction
HTML Elements
HTML Basic Tags
HTML Formatting
HTML Entities
HTML Links
HTML Frames
HTML Tables
HTML Lists
HTML Forms
HTML Images
HTML Background

HTML Advanced
HTML Layout
HTML Fonts
HTML 4.0 Why
HTML Styles
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML Webserver

Examples/Quiz
HTML Examples
HTML Quiz Test

References
HTML Quick List
HTML Tag List
HTML Attributes
HTML Events
HTML ASCII
HTML Entities
HTML Colors
HTML Colorvalues
HTML Colornames
HTML HTTP

Please visit our sponsors !

HTML Frames

Previous Next

With frames, you can display more than one Web page in the same browser window.


Examples

Vertical frameset
This example demonstrates how to make a vertical frameset with three different documents.

Horizontal frameset
This example demonstrates how to make a horizontal frameset with three different documents.

More Examples


Frames

With frames, you can display more than one HTML document in the same browser window. Each HTML document is called a frame, and each frame is independent of the others.

The disadvantages of using frames are:

  • The web developer must keep track of more HTML documents
  • It is difficult to print the entire page

The Frameset Tag

  • The <frameset> tag defines how to divide the window into frames
  • Each frameset defines a set of rows or columns
  • The values of the rows/columns indicate the amount of screen area each row/column will occupy

The Frame Tag

  • The <frame> tag defines what HTML document to put into each frame

In the example below we have a frameset with two columns. The first column is set to 25% of the width of the browser window. The second column is set to 75% of the width of the browser window. The HTML document "frame_a.htm" is put into the first column, and the HTML document "frame_b.htm" is put into the second column:

<frameset cols="25%,75%">
   <frame src="frame_a.htm">
   <frame src="frame_b.htm">
</frameset>


Basic Notes - Useful Tips

If a frame has visible borders, the user can resize it by dragging the border. To prevent a user from doing this, you can add noresize="true" to the <frame> tag.

Add the <noframes> tag for browsers that do not support frames.


More Examples

Mixed frameset
This example demonstrates how to make a frameset with three documents, and how to mix them in rows and columns.

Frameset with noresize="true"
This example demonstrates the noresize attribute. The frames are not resizable. Move the mouse over the borders between the frames and notice that you can not move the borders.

Navigation frame
This example demonstrates how to make a navigation frame. The navigation frame contains a list of links with the second frame as the target. The file called "tryhtml_contents.htm" contains three links. The source code of the links:
<a href ="tryhtml_frame_a.htm" target ="showframe">Frame a</a><br>
<a href ="tryhtml_frame_b.htm" target ="showframe">Frame b</a><br>
<a href ="tryhtml_frame_c.htm" target ="showframe">Frame c</a>
The second frame will show the linked document.

Inline frame
This example demonstrates how to create an inline frame (a frame inside an HTML page).

Jump to a specified section within a frame
This example demonstrates two frames. One of the frames has a source to a specified section in a file. The specified section is made with <a name="C10"> in the "link.htm" file.

Jump to a specified section with frame navigation
This example demonstrates two frames. The navigation frame (content.htm) to the left contains a list of links with the second frame (link.htm) as a target. The second frame shows the linked document. One of the links in the navigation frame is linked to a specified section in the target file. The HTML code in the file "content.htm" looks like this: <a href ="link.htm" target ="showframe">Link without Anchor</a><br><a href ="link.htm#C10" target ="showframe">Link with Anchor</a>.


Frame Tags:

NN: Netscape, IE: Internet Explorer, W3C: Web Standard

Start Tag NN IE W3C Purpose
<frameset> 3.0 3.0 4.0 Defines a set of frames
<frame> 3.0 3.0 4.0 Defines a sub window (a frame)
<noframes> 3.0 3.0 4.0  Defines a noframe section for browsers that do not handle frames
<iframe> 6.0 3.0 4.0  Defines an inline sub window (frame)


Previous Next

Jump to: Top of Page or HOME or Printer Friendly Printer friendly page


Search W3Schools:


What Others Say About Us

Does the world know about us? Check out these places:

Dogpile Alta Vista MSN Google Excite Lycos Yahoo Ask Jeeves


We Help You For Free. You Can Help Us!


W3Schools is for training only. We do not warrant its correctness or its fitness for use. The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2002 by Refsnes Data. All Rights Reserved


Validate How we converted to XHTML Validate

Domain Name Registration
Domain Name
Registration & More!



Your own Web Site?

Read W3Schools
Hosting Tutorial



$15 Domain Name
Registration
Save $20 / year!



Advertise
at W3Schools

Only 0.5 CPM



SELECTED LINKS

University Online
Master Degree
Bachelor Degree


Web Software

The Future of
Web Development


Jobs and Careers

Web Security
Web Statistics
Web Standards


PARTNERS

W3Schools
TopXML
VisualBuilder
XMLPitstop
DevelopersDex
DevGuru
Programmers Heaven
The Code Project
Tek Tips Forum
ZVON.ORG
TopXML Search