Using IFRAME Elements
In Microsoft Internet Explorer 5.5 and later, frames are windowless, resulting in greatly improved performance. In addition, Internet Explorer 5.5 and later can now overlap IFRAME elements—also known as inline floating frames—and can make the content inside inline floating frames transparent.
Inline floating frames provide the following features:
- Increased performance over previous versions of Internet Explorer. Internet Explorer 5.5 and later have been optimized to handle inline floating frames more efficiently. This means faster rendering, less memory, and faster scrolling.
- Inline floating frames can be stacked over other inline floating frames.
- Inline floating frames can contain transparent content.
The following topics are discussed in this document:
- Creating Inline Floating Frames
- Using Transparency with Inline Floating Frames
- Stacking Inline Floating Frames
- Related topics
To create a inline floating frame, use the IFRAME tag.
<iframe name="Frame1" src="frame.htm" > </iframe>
You can also place content into the previous IFRAME tag by using a frame destination, as follows:
<a href="http://www.microsoft.com" target="Frame1">See Microsoft's Web Site</a>
The previous example creates a hyperlink that navigates to Microsoft's Web site inside the inline floating frame. It uses the TARGET attribute to load the Web page into the IFRAME. The NAME attribute on the IFRAME tag indicates the TARGET for the A tag.
Security Warning: To protect user privacy and safeguard your applications, Internet Explorer restricts some interactions between frames that host Web pages from different domains. For more information about using the Dynamic HTML (DHTML) object model with the frame and iframe objects, see About Cross-Frame Scripting and Security and Security Considerations: Dynamic HTML.
Although Internet Explorer has supported transparent elements since Microsoft Internet Explorer 4.0, only Internet Explorer 5.5 and later support transparent content with inline floating frames.
The following conditions must be met to define transparent content for inline floating frames.
- The ALLOWTRANSPARENCY attribute, used with the IFRAME element, must be set to
- In the IFRAME content source document, the background-color or BGCOLOR attribute of the BODY element must be set to
<html> <body style="background-color:transparent"> <p>Transparent.</p> </body> </html>
The following example shows how the IFRAME element is written for transparent content.
<iframe name="Frame1" src="frame.htm" allowTransparency="true"> </iframe>
Internet Explorer 4.0 and later supports the z-index attribute. However, only Internet Explorer 5.5 and later support the z-index attribute with inline floating frames. By specifying the z-order of floating frames, you can stack one frame on top of another.
To specify the position of the inline floating frame, use the z-index attribute.
<iframe src="frame.htm" style="z-index:1" > </iframe>
Items are stacked from a smaller z-index value to a larger z-index value, and the value can be negative.