1. Computing

Discuss in my forum

Attributes of the Frame Tag

Modifying Your Frames

By

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.

©2014 About.com. All rights reserved.