Frames

Contents:

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.

Summary of Frame Tags

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>.

Attributes

<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.

Attributes

<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.

Attributes

<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.