DHTML III                

   Contact
   C
   C++
   Visual Basic
   Java
   JavaScript
   DHTML
   Style Sheets
   About
   Normalization
   Active X
   TDC Binding
   PHP
   Perl and CGI
   Flash
   XML
   SQL
   Chat
   MCSE
   Linux
   Cabling   
 

   
 
    
    
DHTML 1  DHTML 2  Home  DHTML 4  Example 
DHTML Part 3 - Fun with Frames

Frames can provide innovative ways to display web pages and a convenient way to menu and navigate a site.  On the other hand, they can make a site extremely difficult to promote in the search engines and waste a lot of screen real estate.  If overused, they become distracting and annoying.  One should use them judiciously in any web project.  A framed page begins with a master frame set.  This frame set specifies the frame objects that will make up the page, columns and rows, and width.  Every frame object on this master frameset page is then loaded into the browser as though it were its own miniature page.  Example:

<HTML>
<frameset cols = "110,*">

<frame name = "menu" src = "menu.html" />
<frame name = "main" src = "main.html" />

<noframes>
<p>This page uses frames, but your browser does not support them.</p>
<p>So, <a href = "nonframed.html">click HERE for a non-framed version</a>.</p>
</noframes>
</frameset>
</HTML>


The cols = "110" specifies that the first frame object, starting on the left, will be 110 pixels across.  The " * " specifies that the next frame object, starting in the next column,  can take up the remaining space on the page. 

Consider another example, this time using 3 frame objects and rows and columns:

  <frameset cols = "110,*">
      <frame name = "menu" src = "menu.html" />

      <!-- We are nesting one frameset inside of another -->
      <frameset rows = "175,*">
         <frame name = "photo" src = "photo.html" />
         <frame name = "main" src = "main.html" />
      </frameset>

      <noframes>
         <p>This page uses frames, but your browser does not 
         support them.</p>

         <p>Please, <a href = "nav.html">follow this link to 
         browse our site without frames</a>.</p>
      </noframes>

   </frameset>

In this particular instance, we specified that the left frame object named "menu" will be 110 pixels wide, and that the remaining pixels in the frame set will be given to the next frame set nested within the original.  At this point, rows = "175, *" specifies that in the second set, the first declared frame object will span 175 pixels down and that the second declared frame object will get the remaining space on the page (minus the 110 pixels taken by the frame object in the left column and the 175 pixels taken by the frame in the top right.)

DHTML 1  DHTML 2  Home  DHTML 4  Example