Unit 5.4. Basic Frames

Frames and Framesets

A frame document is used to set up separate spaces on a page for separate HTML documents. Every frame document begins with a FRAMESET tag. This tag replaces the BODY tag you find in regular HTML documents. The frameset defines how the page will be divided up, and it can be described in terms of either horizontal units (rows) or vertical units (columns), but not both (you can obtain this latter effect by nesting a frameset inside another frameset, which is covered in Chapter 6, “Advanced HTML: Forms, Nested Tables, and Nested Frames.”)

To define a frameset in terms of rows, for example, you must first decide how big you’d like each row to be. The rows can be sized relatively (using the percentage of the screen width), or by absolute value (in pixels).

Copy your Table.htm file to a new file called Main_Frame.htm. This file should consist of the following example HTML code:

<HTML> 
<HEAD> 
<TITLE>Main Frameset for the University Maintenance Website 
for Administrators</TITLE> 
</HEAD> 
<FRAMESET ROWS="25%, 75%">
							</FRAMESET> 
</HTML> 

So here you can see that there are two rows. The top row will take up 25% of the screen width and the bottom row will take up 75% of the screen width. Note that values are separated by a comma.

A frameset always divides up all of the available space in a browser window. A frameset can never take up more or less than the available screen space. If the percentages provided in the <FRAMESET> tag add up to more or less than 100%, the browser will attempt to recalculate percentages, and divide up all of the available screen space according to its recalculations, often with unpredictable results. Similar recalculations are made when numeric pixel values provided do not add up to the available area of the browser window.

You can also use an asterisk (*) to indicate that all remaining space should be used. To create two columns, one that has a fixed width of 110 pixels, and a second column that fills up the rest of the screen, however wide that is, use this notation for the <FRAMESET> tag:

<FRAMESET COLS="110,*"> 

After you’ve defined the frameset, you can then describe the frames within it. Each frame (region) in a document is described by a single frame tag. The FRAME tag has several attributes, the two most common being the SRC (Source) and the NAME attributes. The SRC tag tells the browser which document to pull into the frame. The NAME attribute becomes important when you want to link between frames.

Frames are always described from left to right, and top to bottom.

Add the following FRAME tags to your Main_Frame.htm document.

<HTML> 
<HEAD> 
<TITLE>Main Frameset for the University Maintenance Web
site for Administrators</TITLE> 
</HEAD> 
<FRAMESET ROWS="25%, 75%"> 
<FRAME SRC="Top_Nav.htm" NAME="top">
							<FRAME SRC="Splash.htm" NAME="main"> 
</FRAMESET> 
</HTML> 

So again, SRC (Source) indicates the HTML document to be pulled into this frame. And NAME is simply the name assigned to the frame (which doesn’t necessarily have to correspond to the name of the HTML document).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.167.183