home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Frame Tags

Framed layouts are ones in which the browser window is broken into multiple regions called frames. Each frame can contain a distinct HTML document, enabling you to display several documents at once, rather than just one (see Figure 3.19).


FIGURE 3.19  Frames enable you to keep key page elements (such as navigation) on the screen all the time, while other parts of the page change.

You need to know only a few tags to set up a framed page. These tags are covered in this section.

See “Frames,” p. 211.

<FRAMESET>

Type:

Container

Function:

Divides the browser window into frames.

Syntax:

<FRAMESET ROWS=”list_of_row_sizes” COLS=”list_of_column_sizes”>
...
</FRAMESET>

Attributes:

<FRAMESET> can take the ROWS or COLS attribute, but not both at the same time. ROWS specifies how the browser screen should be broken up into multiple rows. ROWS is set equal to a list of values that describe the size of each row. The number of items in the list determines how many rows there will be. The values in the list determine the size of each row. Sizes can be in pixels, percentages of screen depth, or relative to the amount of available space. COLS works the same way, except it will divide the screen into columns.


NOTE:  If you try to use ROWS and COLS in the same <FRAMESET> tag, a browser will typically use the first attribute it finds and ignore the second.

Example:

<!-- Divide the screen into four rows: 125 pixels, 30% of screen,
     88 pixels, and whatever is left over. -->
<FRAMESET ROWS=”125,30%,88,*”>
...
</FRAMESET>

Related Tags:

<FRAMESET> only breaks up the screen into multiple regions. You need to use the <FRAME> tag to populate each frame with content. Also, you can use the <NOFRAMES> tag to specify alternative content for browsers that cannot process frames.


NOTE:  <FRAMESET> tags may be nested to create even more complex layouts.

<FRAME>

Type:

Standalone

Function:

Places content into a frame.

Syntax:

<FRAME SRC=”URL_of_document” NAME=”frame_name” FRAMEBORDER=”0|1"
  MARGINWIDTH=”width_in_pixels” MARGINHEIGHT=”height_in_pixels”
  NORESIZE SCROLLING=”YES|NO|AUTO” LONGDESC=”URL_of_description”>

Attributes:

The <FRAME> tag can take several attributes:

  FRAMEBORDER—Setting FRAMEBORDER to 1 turns on the frame’s borders; setting it to 0 turns them off.
  LONGDESC—Set equal to the URL of a resource that contains a more detailed description of the frame’s content.
  MARGINHEIGHT—Specifies the size (in pixels) of the top margin of the frame.
  MARGINWIDTH—Specifies the size (in pixels) of the left margin of the frame.
  NAME—Gives the frame a unique name so it can be targeted by other tags (such as <A>, <FORM>, and <AREA>).
  NORESIZE—Suppresses the user’s ability to drag and drop a frame border in a new location.
  SCROLLING—Controls the presence of scrollbars on the frame. Setting SCROLLING to YES makes the browser always put scrollbars on the frame, setting it to NO suppresses the scrollbars, and setting it to the default of AUTO enables the browser to decide whether the scrollbars are needed.
  SRC—Tells the browser the URL of the HTML file to load into the frame. SRC is a required attribute of the <FRAME> tag.

Example:

<FRAMESET COLS=”25%,75%”> <!-- Make 2 columnar frames -->
   <!-- Populate frame #1 -->
   <FRAME SRC=”leftframe.html” NORESIZE NAME=”left” FRAMEBORDER=0>
   <!-- Populate frame #2 -->
   <FRAME SRC=”rightframe.html” NORESIZE NAME=”right” FRAMEBORDER=0>
...
</FRAMESET>

Related Tags:

The <FRAME> tag is valid only between the <FRAMESET> and </FRAMESET> tags.

<NOFRAMES>

Type:

Container

Function:

Provides an alternative layout for browsers that cannot process frames.

Syntax:

<NOFRAMES>
... non-frames content goes here ...
</NOFRAMES>

Attributes:

None.

Example:

<FRAMESET COLS=”25%,75%”> <!-- Make 2 columnar frames -->
   <!-- Populate frame #1 -->
   <FRAME SRC=”leftframe.html” NORESIZE NAME=”left” FRAMEBORDER=0>
   <!-- Populate frame #2 -->
   <FRAME SRC=”rightframe.html” NORESIZE NAME=”right” FRAMEBORDER=0>
<NOFRAMES>
Your browser cannot process frames.  Please visit the
<A HREF=”/noframes/index.html”>non-frames version</A>
of our site.
</NOFRAMES>
</FRAMESET>

Related Tags:

<NOFRAMES> is valid only between the <FRAMESET> and </FRAMESET> tags. Your <NOFRAMES> content should be specified before any nested <FRAMESET> tags.

<IFRAME>

Type:

Container

Function:

Places a floating frame on a page. Floating frames are best described as “frames that you can place like images.”

Syntax:

<IFRAME SRC=”URL_of_document” NAME=”frame_name” FRAMEBORDER=”0|1"
  WIDTH=”frame_width_in_pixels_or_percentage”
  HEIGHT=”frame_height_in_pixels_or_percentage”
  MARGINWIDTH=”margin_width_in_pixels”
  MARGINHEIGHT=”margin_height_in_pixels”
  SCROLLING=”YES|NO|AUTO” ALIGN=”TOP|MIDDLE|BOTTOM|LEFT|RIGHT”
  LONGDESC=”URL_of_description”>
... text or image alternative to the floating frame ...
</IFRAME>


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.