home -- outline -- lectures -- assignments -- discussion -- tips -- links --




HTML FRAMES Chapter 12 in HTML: The Definitive Guide

Frames
  • Allows you to display several inter-related documents at once.
  • Supported by Netscape & Microsoft
  • Often the same effect can be simulated with repeated image maps.
  • User operation is less intuitive than regular Web pages.

Two "classes" of html documents
  • Layout Documents.
    • Contain information on the frame structure of the page, and a "pointer" to the contents of each frame.
  • Contents Documents.
    • Contain the standard HTML that is actually displayed (in this case in a frame).

Layout Document
  • This is a html page that details your frame layout.
    It does not contain a <BODY> .. </BODY> tag.
    <FRAMESET
         [COLS=#|%] 
         [ROWS=#|%]
         [FRAMEBORDER=yes | no]
         [BORDER=#] 
         [BORDERCOLOR =#RGB] 
         
    ............................................... >


      < FRAME SRC=" source.html"> < FRAME SRC=" source.html"> < FRAME SRC=" source.html"> < FRAME SRC=" source.html">
    </FRAMESET>

    <FRAMESET>
    • Frameset may be nested.
    • Frameborder (yes = 3D; no = line).
    • Border thickness (BORDER) may only be set on outer-most Frameset.
    • ROWS and COLS attributes allow '*', which tells the browser to allocate the space that's left proportionally

    FRAMESET
    • Use <FRAME> to define contents Page.
      • Frames filled left->right, then top->bottom.
    • Use <NOFRAME> ... </NOFRAME> to provide non-frame page contents. Only use in outer-most <FRAMESET>.



    <FRAME> Tag
      <FRAME SRC=URL
           [NAME="FrameName"]
           [NORESIZE] 
           [SCROLLING=yes|no] 
           [MARGINHEIGHT=#]
           [MARGINWIDTH=#] 
           [FRAMEBORDER=yes | no] 
           [BORDERCOLOR=#RGB] 
          
      ............................................... >

    Frame Example 1

    Frame Example 2

    Direct Nesting of Framesets
      <FRAMESET ROWS=2>  
           <FRAME SRC="DOC-1.HTML">  
           
           <FRAMESET COLS=2>    
                <FRAME SRC="DOC-2.1.HTML">
                <FRAME SRC="DOC-2.2.HTML">
           </FRAMESET>   
      
      </FRAMESET> 
      

    Indirect Nesting
      <FRAMESET ROWS=2>      
           
           <FRAME SRC="DOC-1.HTML">
           <FRAME SRC="NEW-DOC-2.HTML">
      
      </FRAMESET> 
      
      • where NEW-DOC-2.HTML contains:
      <FRAMESET COLS=2> <FRAME SRC="DOC-2.1.HTML"> <FRAME SRC="DOC-2.2.HTML"> </FRAMESET>


    Named Frame (Target)

    • Hyperlinks have an attribute, TARGET="FrameName".
    • Special Targets:
      • _self (default), _parent, _top, _blank
    • _blank will open a new window. So will any FrameName that has not been defined.


    Frames Online Examples

    Frames Online Summary