Click Here!
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.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


In this example, the display is first divided into three rows: The top and bottom rows are narrow (10% of the available height) and contain nonscrolling documents, while the middle row takes up the remaining 80% of the window height. The middle row is further divided by the second FRAMESET into two columns: The first takes up 20% of the window width, the second taking up the remaining 80%. Both these frames are scrollable, and are named using NAME attributes.

The following is an example of incorrectly defined FRAMEs (comments in italics)

<FRAMESET ROWS=”10%, 80%, 10%>        3 rows, narrow top and bottom

  <FRAME SCROLLING=“no” SRC=“logo+buttonbar.html”>       1st frame
  <FRAMESET COLS="20%, 80%">       2nd frame is a FRAMESET
    <FRAME NAME="navigation" SRC="navigate.html">        containing 2 frames
    <FRAME NAME="main" SRC="main/start.html">
  </FRAMESET>
  <FRAME SCROLLING="no" SRC="credits.html">       3rd frame
  <FRAME SRC="oops.html">        ERROR -- FRAMESET declares
                                 3 rows, but this is the
                                 fourth FRAME!!
</FRAMESET>

The TITLE attribute should contain a TITLE for the frame, for use by non-visual (e.g., text-to-speech) browsers. The attributes CLASS, ID, and STYLE are also allowed. None of these attributes are supported by current browsers.

Note that event-handling attributes are not allowed (however, Internet Explorer 4 does support onBlur, onFocus, onLoad, and onUnload). In general, event handling for a specific frame should be implemented within the document loaded into the frame.

The next sections describe the remaining attributes, and their meanings.

BORDERCOLOR=“#rrggbb,”color” (optional) Sets the color for the frame borders. This overrides any border colors specified by a surrounding FRAMESET element. The color is undefined if two neighboring FRAMEs try and set different colors to an adjacent boundary. BORDERCOLOR is only valid with 3-D frame borders—if FRAMEBORDER=“no,” then the borders are invisible.
FRAMEBORDER=“yes” or “1,” “no” or “0” (optional) Sets the display mode for the frame border—the value “yes” or “1” (the default) creates borders with a three-dimensional effect, while “no” or “0” produces plain borders. The border width is set by the BORDER attribute of the outermost FRAMESET element. Note that Internet Explorer and Navigator treat frame bordering differently, so make sure to test your frame designs on both browsers.
MARGINHEIGHT=“number” (optional)Specifies the height, in pixels, of the top and bottom margins for the frame: The default value is approximately 10 and is browser-specific. MARGINHEIGHT cannot be less than 1 to ensure that there is some blank space left between the frame content and the frame borders. If this attribute is absent, the browser will itself determine a (hopefully) appropriate margin height.
LONGDESC=“string” (optional; not currently implemented) Specifies a long text description of the frame. This is intended for use by text-only or non-graphical browsers, and to supplement the value of TITLE. There are no current browsers that support this attribute.
MARGINWIDTH=“number” (optional)Specifies the width, in pixels, of the left and right margins inside the frame: The default value is approximately 10 and is browser-specific. MARGINWIDTH cannot be less than 1, to ensure that there is some blank space left between the frame content and the frame borders. If this attribute is absent, the browser will hopefully determine an appropriate margin width.
NAME=“name” (optional) Assigns a symbolic name to the particular frame: The TARGET attribute of a FORM or A element can then direct retrieved documents or data to this named frame. If NAME is absent, the frame name is undefined.
NORESIZE (optional) Informs the browser that the frame size is fixed and cannot be modified by the user—this also restricts resizing of adjacent frames in the same window. If this attribute is absent, the frame can be resized, usually by using the mouse to drag a border of the frame.
SCROLLING=“yes,” “no,” “auto” (optional) Specifies the status of scrollbars for the frame. A value of “yes” means that the frame must always have scrollbars, while “no” means that the frame should never have scrollbars. If you use this latter value, you must be sure that the frame is large enough to contain the desired document. The value “auto” lets the browser include scrollbars when necessary. The default value is “auto.”
SRC=“url” (optional) Specifies the URL of the HTML document to be displayed within the frame. SRC can be absent, in which case the frame is initially blank.

NOFRAMES Element: Markup for FRAME-Incapable Browsers

Usage: <NOFRAMES> ... </NOFRAMES>
Can Contain: ADDRESS, BLOCKQUOTE, BODY, CENTER, DIR, DIV, DL, FIELDSET, FORM, Hn, HR, [ISINDEX], MENU, MULTICOL, NOEMBED, NOFRAMES, NOLAYER, NOSCRIPT, OL, P, PRE, TABLE, UL, characters, character highlighting, A, APPLET, BASEFONT, BR, BUTTON, EMBED, IFRAME, IMG, ILAYER, INPUT, KEYGEN, LABEL, LAYER, MAP, OBJECT, SCRIPT, SELECT, SPACER, TEXTAREA, WBR
Can Be Inside: BLOCKQUOTE, BODY, CENTER, DD, DIV, FIELDSET, FORM, MULTICOL, NOEMBED, NOFRAMES, NOSCRIPT, TD, TH, APPLET, BUTTON, IFRAME, OBJECT, FRAMESET, HTML
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers

NOFRAMES contains HTML markup to be displayed by browsers that do not understand the FRAMESET and FRAME elements. NOFRAMES content is not displayed by a FRAME-capable browser. A FRAME-incapable browser, however, ignores the FRAMESET, FRAME, and NOFRAMES elements and displays the NOFRAMES content as if it were the BODY of a regular HTML document.

NOFRAMES was initially introduced to delimit, within a frameset document, markup alternative to the FRAMESET for frame-incapable browsers. In this model, the NOFRAMES element must appear after the last FRAMESET and should contain a BODY element and regular BODY content. The following is an example:

<HTML>
<HEAD>
<TITLE>Test of the NOFRAMES Element</TITLE>
</HEAD>
<FRAMESET ROWS=“50%, 50%”>
   <FRAME SRC=“top_part.html” NAME=“wind1”>
   <FRAME SRC=“bot_part.html” NAME=“wind2”>
</FRAMESET>
<NOFRAMES>
   <BODY BACKGROUND=“greywhale.gif”>
   <H1 ALIGN=“center”> Warning! </H1>
   <P ALIGN=“center”><EM>If you are reading this text, you are viewing this
       document with a FRAMEs-incapable browser--this document was designed
       to be viewed by a FRAME-capable browser, such as Netscape Navigator
       2.0. If you do not have such a browser, please access the alternative
       <A HREF=“noframes.html”>noframes</A> collection.   
   </BODY>
   </NOFRAMES>

</HTML>

HTML 4 also allows NOFRAMES content within the BODY of nonframed documents. This, in principle, allows for regular documents to display certain blocks of markup only when loaded by browsers incapable of displaying frames. Thus, the individual documents loaded into each frame of a “framed” page can contain markup that is hidden when the document is presented in a framed view. Unfortunately, only Internet Explorer 4 supports NOFRAMES elements within the body of a document—Netscape Navigator does not understand NOFRAMES in this way and always displays NOFRAMES content when the element appears inside the body of a regular document.


NOTE: Use NOFRAMES Only after Last FRAMESET in a Frame Document

Netscape Navigator improperly renders documents that contain NOFRAMES elements inside the BODY of an HTML document. For reliable documents, you should therefore only place NOFRAMES elements after the last FRAMESET of a frameset document.




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.