Click to return to the DHTML, HTML     
I Element | I Object     IMG Element | IMG Object     DHTML Objects    
Web Workshop  |  DHTML, HTML & CSS

IFRAME Element | IFRAME Object


Creates inline floating frames.

HTML Syntax

<IFRAME
    ALIGN=ABSBOTTOM | ABSMIDDLE | BASELINE | BOTTOM | LEFT |
         MIDDLE | RIGHT | TEXTTOP | TOP
    BORDER=pixels
    CLASS=classname
    DATAFLD=colname
    DATASRC=#ID
    FRAMEBORDER=NO | YES | 0 | 1
    FRAMESPACING=pixels
    HEIGHT=n
    HSPACE=pixels
    ID=value
    LANG=language
    LANGUAGE=JAVASCRIPT | JSCRIPT | VBSCRIPT  | VBS 
    MARGINHEIGHT=pixels
    MARGINWIDTH=pixels
    NAME=window_name | _blank | _parent | _self | _top
    NORESIZE=NORESIZE | RESIZE
    SCROLLING=AUTO | NO | YES
    SRC=url
    STYLE=css1-properties
    TITLE=text
    VSPACE=pixels
    WIDTH=n
    >

Remarks

The IFRAME element functions as a document within a document, or like a floating FRAME. The frames collection provides access to the contents of an IFRAME. Use the frames collection to read or write to elements contained in an IFRAME. For example, the syntax for accessing the backgroundColor style of the BODY object in an IFRAME is:

sColor = document.frames("sFrameName").document.body.style.backgroundColor;

You can access the IFRAME object's properties, but not its contents, through the object model of the page where the IFRAME object resides. For example, the syntax for accessing the border style of the IFRAME object is:

sBorderValue = document.all.oFrame.style.border;

The IFRAME element is a block element and requires a closing tag.

This element is available in HTML and script as of Microsoft® Internet Explorer 4.0.

Members

Styles

Example

This example uses the IFRAME element and an HTML fragment to create a frame containing the page sample.htm.

<IFRAME ID=IFrame1 FRAMEBORDER=0 SCROLLING=NO SRC="sample.htm"></IFRAME>

This example returns a reference to the all collection of the document contained by the IFRAME.

var collAll = document.frames("IFrame1").document.all


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.