Summary of Frame Tags
Introduction to Frames
Basic Frameset Structure
Frame Function and Appearance
Targeting Frames
Inline (Floating) Frames
Frame Design Tips and Tricks
Frames are a method for dividing the browser window into smaller subwindows, each displaying a different HTML document. This chapter covers the structure and creation of framed documents, controls for affecting their display and function, and some advanced tips and tricks.
In this section, browser support for each tag is noted to the right of the tag name. Browsers that do not support the tag are grayed out. Tag usage is indicated below the tag name. Start and end tags are required unless otherwise noted. "Deprecated" means that the tag or attribute is currently supported but is due to be phased out of the HTML specification and is discouraged from use (usually in favor of similar style sheet controls). "Nonstandard" indicates that the attribute is not part of the HTML specification, but is supported by the major browsers. The attributes listed for each tag reflect those in common use. See "WebTV and Frames" at the end of this chapter for information on WebTV's special handling of framed documents.
A more thorough listing of attributes for each tag, according to the HTML 4.01 specification, appears in Appendix A, "HTML Elements".
<frame> | NN 2, 3, 4, 6 MSIE 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5 |
<frame> (no end tag) |
Defines a single frame within a <frameset>.
Nonstandard. Sets the color for frame's borders (if the border is turned on). Support for this attribute is limited to Netscape Navigator 3.0+ and Internet Explorer 4.0+.
Determines whether there is a 3-D separator drawn between the current frame and surrounding frames. A value of 1 (or yes) turns the border on. A value of 0 (or no) turns the border off. The default value is 1 (border on). You may also set the frameborder at the frameset level, which may be more reliable.
Because Netscape and Internet Explorer support different values, you need to specify the frameborder twice within <frame> to ensure full browser compatibility, as follows:
frameborder=yes frameborder=1 ...
Specifies a link to a document containing a long description of the frame and its contents. This addition to the HTML 4.01 specification may be useful for nonvisual web browsers, but it is currently not well supported.
Specifies the amount of space (in pixels) between the left and right edges of the frame and its contents. The minimum value according to the HTML specification is 1 pixel. Setting the value to 0 in order to place objects flush against the edge of the frame works in Internet Explorer, but Netscape will still display a 1-pixel margin space.
Specifies the amount of space (in pixels) between the top and bottom edges of the frame and its contents. The minimum value according to the HTML specification is 1 pixel. Setting the value to 0 in order to place objects flush against the edge of the frame works in Internet Explorer, but Netscape will still display a 1-pixel margin space.
Assigns a name to the frame. This name may be referenced by targets within links to make the target document load within the named frame.
Prevents users from resizing the frame. By default, despite specific frame size settings, users can resize a frame by clicking and dragging its borders.
<frameset> | NN 2, 3, 4, 6 MSIE 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5 |
<frameset>...</frameset> |
Defines a collection of frames or other framesets.
Nonstandard. Sets frame border thickness (in pixels) between all the frames in a frameset (when the frame border is turned on).
Nonstandard. Sets a border color for all the borders in a frameset. Support for this attribute is limited to Netscape Navigator 3.0 and higher and Internet Explorer 4.0.
Establishes the number and sizes of columns (vertical frames) in a frameset. The number of columns is determined by the number of values in the list. Size specifications can be in absolute pixel values, percentage values, or relative values (*) based on available space.
Nonstandard. Determines whether 3-D separators are drawn between frames in the frameset. A value of 1 (or yes) turns the borders on; 0 (or no) turns the borders off.
Because Netscape and Internet Explorer support different values, you may need to specify the frameborder twice within <frameset> to ensure cross-browser compatibility, as follows:
frameborder=yes frameborder=1 ...
Internet 3.0 and higher only. Adds additional space (in pixels) between adjacent frames.
Establishes the number and size of rows (horizontal frames) in the frameset. The number of rows is determined by the number of values in the list. Size specifications can be in absolute pixel values, percentage values, or relative values (*) based on available space.
<iframe> | NN 6 MSIE 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5 |
<iframe> ... </iframe> |
Defines an inline (floating) frame within a document with similar placement tags to <img>. This element requires a closing tag. Any content contained within the <iframe> tags will display on browsers that do not support inline frames.
Aligns the inline frame on the page within the flow of the text. Left and right alignment allows text to flow around the inline frame.
Turns on or off the displaying of a 3-D border for the inline frame. The default is 1, which displays the border.
Specifies the height of the inline frame in pixels or as a percentage of the window size. Internet Explorer and Navigator use a default height of 150 pixels.
Nonstandard. Used in conjunction with left and right alignment, this attribute specifies the amount of space (in pixels) to hold clear to the left and right of the inline frame.
Specifies a link to a document containing a long description of the inline frame and its contents. This addition to the HTML 4.01 specification may be useful for nonvisual web browsers.
Specifies the amount of space (in pixels) between the top and bottom edges of the inline frame and its contents.
Specifies the amount of space (in pixels) between the left and right edges of the inline frame and its contents.
Determines whether scrollbars appear in the inline frame (see the explanation of this attribute in <frame>, earlier in this chapter).
<noframes> | NN 2, 3, 4, 6 MSIE 3, 4, 5, 5.5, 6 HTML 4.01 WebTV Opera5 |
<noframes> ... </noframes> |
Defines content to be displayed by browsers that cannot display frames. Browsers that do support frames ignore the content between <noframes> tags.
Copyright © 2002 O'Reilly & Associates. All rights reserved.