[ LiB ] |
Frames are not supported by Netscape 4. |
Like a regular frame, an iframe (or inline frame) defines a rectangular area inside a browser window that displays a portion of another document. Unlike standard frames, however, iframes exist within ordinary HTML documents, inside the body tag, just like any other page element (image, table, and so on). Figure 10.31 shows a sample of an iframe at work. Iframes are useful for many of the same reasons standard frames are: They allow partial page contents to change without reloading the entire page, they allow certain page content to scroll while other content remains stationary, and so on. They also have the same accessibility requirements as frames. They're part of the HTML 4 specification and are currently supported by all major browsers.
Dreamweaver only partially supports iframes. Iframes cannot be inserted within Design view, they don't display in Design view, and their properties don't appear in the Property Inspector.
The two mechanisms for inserting iframes are the Tag Chooser and the Floating Frame object. To insert an iframe into a page using the Tag Chooser, do this:
Attribute | Values | Required | Description |
---|---|---|---|
src | Absolute or relative URL | Yes | The file that should appear in the iframe area |
width height | Number, in pixels | Yes | The width and height of the iframe rectangular area |
scrolling | true, false | No | Whether scrollbars will appear in the iframe |
marginwidth marginheight | Number, in pixels | No | The gutter between the edges of iframe area and its content |
border | true/false | No | Whether a visible border surrounds the iframe |
align | left, right, top, middle, bottom | No | How the iframe aligns with surrounding content |
To insert an iframe using the Floating Frame object, prepare your files as specified in steps 12, and then do the following:
This inserts the iframe tag with no properties, so it won't be functional unless you assign properties separately.
After the iframe is created, you can use the Tag Inspector or the Edit Tag dialog box to examine and set its properties. Iframes can't be seen in Design view, but can they be selected using the Tag Selector.
You can select an iframe from within Design view. Just click in the Document window where the iframe should be, and it will appear in the Tag Selector. Of course, if you can't see the iframe, you might have trouble clicking exactly where it isor even remembering exactly what it is. And unlike many other invisible elements ( form tags, for instance), iframes themselves don't display any little gold invisible element icon in Design view. But you can insert a comment between the opening and closing tags of your iframe to help you find it because comments do show gold icons. Do it this way:
From now on, whenever invisible elements are showing, you can select the gold comment icon, and the Tag Selector will display the iframe tag. Click the tag indicator in the Tag Selector to select it, and you can set its properties.
To set iframe properties, choose Modify > Edit Tag to open the Tag Editor, or use the Attributes tab of the Tag Inspector. Iframe properties are detailed in Table 10.4.
Iframes are useful little items and are fairly popular. Several extensions are available on the Macromedia Exchange to help insert and edit them.
[ LiB ] |