Frames Tutor - Lesson 7

The scrollbars that you see can be specified as yes, no or auto.

  1. Yes means the window gets scrollbars - whether they're needed or not
  2. No means there will be no scrollbars, even if your frame contents are as big as New Jersey... the browser will simply display as much as it can.
  3. Auto is the default. If scrollbars are needed, they appear, if they are not needed they stay convienently out of the way.

Leaving the default (auto) is usually the best choice. However, for our purposes here, let's get rid of the scrollbars.

 
<frameset cols="146,*">
  <frameset rows="162,*">
    <frame src="world.gif" scrolling="no">
    <frame src="lisa.html">
  </frameset>
  <frame src="terri.html">
</frameset>

VIEW IT

Keep in mind, that you should be very careful about turning off the scrollbars. I see many many pages where this was done, and the author never bothered to see how those frames looked at other resolutions or font sizes. Well, for some visitors, the bottoms of all the frames are chopped off and there's no way to see the rest of that frame. Mess with the scrolling only when absolutely necessary and know what it's going to look like at different resolutions.


Ok. Back to framing. We still have a problem. The image is not in the frame properly. The next two attributes deal with margins.

The browser automatically gives each frame some empty space around its contents. This is normally necessary for aesthetics. You can control the size of these margins by using marginwidth and marginheight. They control the left/right and top/bottom margins respectively. We will set them both to 0.

 
<frameset cols="146,*">
  <frameset rows="162,*">
    <frame src="world.gif" scrolling="no" marginwidth="0" marginheight="0">
    <frame src="lisa.html">
  </frameset>
  <frame src="terri.html">
</frameset>

VIEW IT


Now, while that's pretty close, it might need some fudging. Depending on the browser, it might be an exact fit, or it might just be close. Different browsers sometimes have different ideas about how to measure frame size. A good rule of thumb is to add a couple pixels to the frame dimensions just to be on the safe side...

 
<frameset cols="148,*">
  <frameset rows="164,*">
    <frame src="world.gif" scrolling="no" marginwidth="0" marginheight="0">
    <frame src="lisa.html">
  </frameset>
  <frame src="terri.html">
</frameset>

VIEW IT

<< BACK NEXT >>