|
|
|
|
|
|

spacer

FRAMES 


WHAT ARE FRAMES?

Frames are a collection of individual web documents that together make one web screen or one web page. By dividing a page, called a frameset, into frames, you can allow the visitor to see more than one page without completely covering up their screen. Each frame contains its own web page, that otherwise could be viewed independently in a separate window. Think of a frameset as a window with individual panes. Each pane (called a frame) contains a separate Web document. It is up to you, the web page designer, to decide the number and the dimensions of the panes.

See Castro Chapter 10 page 167 to 176




EXAMPLES

Web sites that use frames include:

The HTML VQS Web site
The Pitman Business College Web site

Most of the major web sites do not use frames: Yahoo, Amazon, C|NET; Microsoft; eBay. There must be good reasons why these major web sites decided not to use frames.


PROs AND CONs

While frames may appear attractive and cool, working with frames and managing frames can be difficult and cumbersome. Errors in tags and coding may result in some very strange looking web pages. If people are not trained to use frames correctly adding content and updating web sites can be difficult.


EXAMPLE AND EXERCISE

Study the example below. Note the structure of this master document and the references made to four other HTML documents: red.htm, green.htm, blue.htm, and white.htm. In total, five independent HTML documents are required here.

<HTML>
<HEAD>
<TITLE>Simple frameset</TITLE>
</HEAD>
<FRAMESET cols="40%,*" rows="60%,*">
<FRAME name="topleft" src="red.htm">
<FRAME name="topright" src="green.htm">
<FRAME name="botleft" src="blue.htm">
<FRAME name="botright" src="white.htm">
</FRAMESET>
</HTML>

Create this simple frameset document shown here [call it home.htm and save it in a new folder called: frames] and create the four other simple HTML documents: one simple sentence for each and an appropriately coloured background. When complete, launch the home.htm document.


MANAGING FRAMES

TARGETS

When a reader activates a link in a framed document, that link will load into the same frame. You can control the contents of frames by using targets.

<A href="http://www.yahoo.com" target="topleft">Yahoo!</A>

This tag, if placed inside of white.htm, would launch the yahoo.com site within the "topleft" frame previously occupied by "red.htm".

FYI: Open a link in a new window

You may open a link in a new window [even without using frames] by using target="_blank" inside of the anchor tag.

<A href="http://www.yahoo.com " target="_blank">Yahoo!</A>


RESOURCES

HTML 4 Chapter 10

www.cookwood.com

Building a Basic Frameset

Why Frames Suck (Most of the Time)