|
For examples of framed pages and sample code to create them, see the Frames Examples Page.
|
| HTML Tag |
Attributes (options) |
Description |
| FRAMESET |
|
FRAMESET replaces the BODY tag in your page and requires an ending <FRAMESET> tag. It is used to define the outermost level of your frames, similar to the TABLE tag when using tables. And Like tables, FRAMESETs can be nested one within another to further subdivide your page into windows.
|
COLS=n|%|*
ROWS=n|%|*
|
Defines how many rows (ROWS) or columns (COLS) to divide the browser into, as well as the size that each window (FRAME) is to be. n specifies the height (for rows) or width (for columns), in pixels of a frame. % specifies the height or width of a frame as a percentage of the overall browser window size. * is used to specify a relative height or width of a frame based on the remaining available space. You must set either COLS or ROWS (one or the other, not both) for each FRAMESET tag you define.
Here's an example of a FRAMESET that would divide the browser window into two rows, one with a height of 50 pixels, with the other one automatically filling up the remaining browser area:
<FRAMESET ROWS="50,*">
|
FRAMEBORDER=1|0
|
Specifies whether the FRAMESET should display 3D borders. If not specified, the default value is 1, which will display borders. If 0 is specified, no borders will be displayed (borderless frames). Additional information about borderless frames.
|
FRAMESPACING=n
|
Specifies the amount of spacing, in pixels, that will appear between the contents of each frame and it's borders, where n represents the number of pixels the extra spacing should be.
|
| FRAME |
Defines a single frame in a FRAMESET. This is not a container tag and does not require an ending tag.
|
|
SRC="url"
|
Identifies the URL of the document that is to be loaded in the FRAME, where url represents the URL or page name of the document you want to be displayed in the frame.
|
|
NAME="frame_name"
|
An optional attribute that assigns a name to the frame so that it can be used to TARGET links into (see below for more on using TARGET), where frame_name can be any meaningful name that you make up.
|
|
NORESIZE
|
An optional flag that specifies that the frame cannot be resized by clicking and dragging on it's borders. If not specified, frames can be resized.
|
|
SCROLLING="yes|no|auto"
|
An optional attribute that designates whether a FRAME should have scrollbars or not. If not specified, auto is the default, which means the browser will determine whether scroll bars should be displayed or not. If yes is specified, scroll bars will always be visible, and if no is specified, no scroll bars will be displayed (which means that if your the page your displaying to a FRAME doesn't fit within that frame, you visitor will not be able to scroll to see the rest of the page).
|
MARGINHEIGHT=n
|
Specifies the height of the margin, where n specifies the margin height in pixels.
|
MARGINWIDTH=n
|
Specifies the width of the margin, where n specifies the margin width in pixels.
|
| TARGET |
When using frames, it's useful to have a link in one frame display the linked page in a different frame. For example, if you've created a two-frame page where one frame contains a navigation bar, and the other frame is your "main" frame where you want all links to be displayed, you'd use the TARGET attribute on the A HREF= tag (the tag that identifies the page you're linking). In other words, something like this:
<A HREF="mypage.htm" TARGET="_parent">Go here </A>
<A HREF="mypage.htm" TARGET="frame_name">Go here </A>
If TARGET is not specified, the linked page will be displayed in the frame that contains the A HREF= tag. There are several options you can use to control where the linked page is to be displayed. You can specify the NAMEd (see above) frame of the existing page the linked page is to be displayed in, you can have the linked page be displayed in a separate browser window, or you can have the linked page be displayed in the same browser all by itself (without any frames). Below are descriptions of the options of TARGET you can use to control where the linked page is to be displayed. Note that the TARGET words with the underline ("_") at the beginning are reserved words. Any other TARGET words with an underline at the beginning will be ignored. Additional information on using TARGET.
|
|
frame_name
|
Specifies the NAMEd FRAME where you want the linked page to be displayed in.
|
|
_parent
|
Specifies that the linked page is to be loaded in the browser on top of the existing page (becomes _self if you have no parent).
|
|
_top
|
Similar to _parent, loads the linked page at the top level (becomes _self if you are at the top).
|
|
_self
|
Load the linked page into the same frame that contains the link.
|
_blank
|
Loads the linked page into a new, unnamed browser window (opens another instance of your browser).
|
| NOFRAMES |
This is a container tag that requires an ending </NOFRAMES> tag. It is used to provide a message to visitors of your page who do not have a frames capable browser, and should be placed before the last </FRAMESET> tag. Visitors that do not have a frames capable browser will see everything that you've put between <NOFRAMES> and </NOFRAMES>. See the Frames Examples page for an example of how NOFRAME can be used.
|
| IFRAME |
ALIGN="top|middle|
bottom|left|right"
|
Defines a "floating" frame. A floating frame is a frame that can be used to display a page within a page. For example, you can place a floating frame inside a table cell. This is a container tag and requires an end tag. ALIGN is used to set the alignment of the frame or the surrounding text.
|
| WIDTH=n |
Specifies the width, in pixels, of the floating frame. |
| HEIGHT=n |
Specifies the height, in pixels, of the floating frame |
| FRAMEBORDER=1|0 |
Same as for FRAME |
| MARGINHEIGHT=n |
Same as for FRAME |
| MARGINWIDTH=n |
Same as for FRAME |
| NAME="frame_name" |
Same as for FRAME |
| SCROLLING="yes|no" |
Same as for FRAME |
| SRC="url" |
Same as for FRAME |