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


splits the window into four columns (see Figure 7.4). The first column is 135 pixels wide; the second is 75 pixels wide; and the remaining space is divided between the third and fourth columns, with the third column four times as wide (4*) as the fourth (*).


CAUTION:  

Don’t put a ROWS and a COLS attribute in the same <FRAMESET> tag. Frames-capable browsers can do only one at a time. Normally, these browsers will act on the first attribute they encounter.


The <FRAMESET> tag can also take two script-related attributes: onload and onunload. These event handlers execute the script code you assign to them when the framed layout is loaded and unloaded, respectively.


Netscape Navigator and Microsoft Internet Explorer still recognize the FRAMEBORDER attribute of the <FRAMESET> tag, which you can use to set the thickness of the border between frames. You can even set FRAMEBORDER to zero so that frames appear seamless (no visible boundaries between frames so that the layout looks continuous). The HTML 4.0 recommendation calls for FRAMEBORDER to be an attribute of the <FRAME> tag discussed later in the chapter.


FIGURE 7.3  The <FRAMESET> tag enables you to break the browser screen into any number of rows...


FIGURE 7.4  ...or into any number of columns. You have control over how big each row or column will be.

Nesting <FRAMESET> Tags to Achieve Complex Layouts

To produce really interesting layouts, you can nest <FRAMESET> and </FRAMESET> tags. Suppose you want to split the browser window into eight equal regions. You can first split the screen into four equal rows with the following HTML:

<FRAMESET ROWS=”25%,25%,25%,25%”>
...
</FRAMESET>

This produces the screen shown in Figure 7.5.

Next, you need to divide each row in half. To do this, you need a <FRAMESET> tag for each row that splits the row into two equal columns. The HTML

<FRAMESET COLS=”50%,50%”>
...
</FRAMESET>

does the trick. Nesting these tags in the HTML at the beginning of this section produces the following:

<FRAMESET ROWS=”25%,25%,25%,25%”>
     <FRAMESET COLS=”50%,50%”> <!-- Split Row 1 into two columns -->
          ...
     </FRAMESET>
     <FRAMESET COLS=”50%,50%”> <!-- Split Row 2 into two columns -->
          ...
     </FRAMESET>
     <FRAMESET COLS=”50%,50%”> <!-- Split Row 2 into two columns -->
          ...


FIGURE 7.5  The first step in producing a complex framed layout is to split the browser screen into rows or columns.

     </FRAMESET>
     <FRAMESET COLS=”50%,50%”> <!-- Split Row 4 into two columns -->
          ...
     </FRAMESET>

     </FRAMESET>

The HTML above completes the task of splitting the window into eight equal regions. The resulting screen is shown in Figure 7.6.


Not sure whether to do a <FRAMESET> with ROWS or COLS first? Take a look at your sketch of the browser window. If you have unbroken horizontal lines that go from one edge of the window to the other, do your ROWS first. If you have unbroken vertical lines that go from the top of the window to the bottom, do your COLS first.

Of course, you’re not limited to making regions that are all the same size. Suppose you want an 108-pixel-wide table of contents frame to appear down the left side of the browser window, and on the right side, you need a 92-pixel row for a logo; the balance of the right side is for changing content. In this case, you could use the HTML

<FRAMESET COLS=”108,*”>  <!-- Split screen into two columns. -->
   ...                  <!-- Placeholder for table of contents. -->
<FRAMESET ROWS=”92,*”>  <!-- Split column 2 into two rows. -->
          ...    <!-- Placeholder for logo. -->
          ...    <!-- Placeholder for changing content frame. -->
     </FRAMESET>
</FRAMESET>


FIGURE 7.6  You further divide the initial rows or columns to produce the final layout.

The ellipses you see in the preceding code are placeholders for the tags that place the content into the frames that the <FRAMESET> tags create. You put a document in each using the <FRAME> tag discussed in the next section.

Placing Content in Frames with the <FRAME> Tag

Using <FRAMESET> tags is only the beginning of creating a framed page. After the browser window is split into regions, you need to fill each region with content. The keys to doing this are the <FRAME> tag and its many attributes.

With your frames all set up, you’re ready to place content in each frame with the <FRAME> tag. The most important attribute of the <FRAME> tag is SRC, which tells the browser the URL of the document you want to load into the frame. The <FRAME> tag can also take the attributes summarized in Table 7.1. If you use the NAME attribute, the name you give the frame must begin with an alphanumeric character.


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.