Attributes of the Frame Tag

Modifying Your Frames

Filling Your Framesets
When you create a framed page, the page that shows up in the URL has no real content (unless you have a <noframes> version). Instead, you create <frame> pages which provide the information for your page.

The <frame> tag has 8 attributes associated with it.

  • src
    This is the only required attribute for the frame tag. The value of this attribute is the URL of the document you would like to be displayed in the frame.

    You can reference any HTML object, image, or multimedia element that could normally be displayed by a Web browser. (Keep in mind, if you use an image, it will not be tiled like a background image, but rather just displayed once.)

  • name
    This allows you to label your frames so that you can open new pages in specific frames. If you do not name your frames, all links will open in the frame that they are in.

  • noresize
    When you set the size of your frames, your readers can come in and change that size to suit them, unless you use the noresize attribute. This allows you to keep control of the layout of your page.

  • scrolling
    This attribute dictates the behavior of a scrollbar on your frames. If the frame is larger than the browser window, a scrollbar will appear. If you never want the scrollbars to appear, put scrolling=no in your frame tag. The "yes" option dictates that there will always be a scrollbar on the frame, even if there is nowhere to scroll. The option "auto" is only supported by Netscape, and allows the browser to decide whether to show a scrollbar or not.

  • marginheight
    This attribute defines how tall the margin between frames will be. It cannot be less than 1 pixel. Also, if the browser cannot display the desired values, then this attribute will be ignored.

  • marginwidth
    This attribute defines how wide the margin between frames will be. It cannot be less than 1 pixel. Also, if the browser cannot display the desired values, then this attribute will be ignored.

  • frameborder
    This attribute allows you to add or remove borders from a single frame on your page. Use the values "yes" or "1" to enable borders and "no" or "0" to disable borders. This attribute is handled differently in IE and Netscape, so if you want to use it, you should define the borders in all frames in your frameset so that you get a consistent view.

  • bordercolor (Netscape only)
    With Netscape, you can change the color of the frame's border using this tag. Use a color name or hex triplet, the same way you would with any other color attribute. Keep in mind that if two adjacent frames have different bordercolor's the border color will end up undefined.

Noframes Content

This tag allows readers without frames-enabled browsers to view your page. The most common use of this tag is to dictate what browser people should use:
<frameset rows="10%,*">
<frame name=toc src="toc.html">
<frame name=home src="home.html">

This document is framed. Go to <a href="">Microsoft< or <a href="">Netscape< to get a better browser!


I believe that this is a mistake. Why are you driving people away from your pages? It is really easy to direct people to the first page of your frameset within the noframes tag. Just add in:
This document is framed, however, you can view the page at <a href="home.html">home.html</a>

If you're willing to spend a small amount of extra time, you can copy in the contents of your main page into the <noframes> portion of your frameset. This will result in very little loss of quality for your frameless readers. They will be more likely to come back and read your page again, and that's the goal, isn't it?