The frame Element
Last update on: 08-15-2008The frame element indicates what goes in each frame of the frameset. The frame element is always an empty element, and therefore should not have any content, although each <frame> element should always carry one attribute, src, to indicate the page that should represent that frame.
The <frame> element can carry any of the universal attributes, and the following attributes:
frameborder marginwidth marginheight noresize scrolling src name
The src Attribute
The src attribute indicates the file that should be used in the frame.
src="main_page.html"
The value for the src attribute is a normal XHTML page so you must have a corresponding page for each <frame /> element.
While the value of this attribute will generally be a file on your server, its value can be any URL, so you could use the src attribute to specify another site.
The name Attribute
The name attribute allows you to give a name to a frame; it is used to indicate which frame a document should be loaded into. This is especially important when you want to create links in one frame that load pages into a second frame, in which case the second frame needs a name to identify itself as the target of the link.
name="main_frame"
The frameborder Attribute
The frameborder attribute specifies whether or not the borders of that frame are shown; it overrides the value given in the frameborder attribute on the <frameset> element if one is given, and the possible values are the same.
frameborder="1" or frameborder="0" you can use yes or no too instead of 1 and 0.
The marginwidth and marginheight Attributes
The margin is the space between the three-dimensional border of a frame and its contents.
The marginwidth attribute allows you to specify the width of the space between the left and right of the frame’s borders and the frame’s content. The value is given in pixels.
The marginheight attribute allows you to specify the height of the space between the top and bottom of the frame’s borders and its contents. The value is given in pixels.
marginheight="10" marginwidth="10"
The noresize Attribute
By clicking and dragging on the borders of a frame you are usually able to resize that frame. For users, this is helpful if they cannot read everything in a frame, but it does make it harder for the designer to control the layout of the page.
The noresize attribute prevents a user from being able to resize the frame. It used to be a minimized attribute without a value in HTML 4, but now it should take a value of noresize.
noresize="noresize"
The scrolling Attribute
If the content of a frame is too big for the space it has been allocated, the browser will likely provide the user with scrollbars so she can read the rest of the content for that frame.
You can control the appearance of the scrollbars that appear on the frame using the scrollbar attribute:
scrolling="yes" It takes no, and auto values.
Working with Frames's lessons:
Introduction To FramesWhen To Use Frames
The Frameset Element
The Frame Element
The Noframes Element
Creating Links Between Frames

