This element departs from the standard FRAME structure syntax.
This IN-LINE framing method (also called "floating
frames") is basically a method to embed other HTML documents
within the framework of a regular HTML document structure with the
level of placement control allowed by the IMG element. In implementation
and display it is created and treated much like the OBJECT element is -
backwards compatibility is achieved by having the contents of the
element ignored by browsers that understand IFRAME.
Note: HTML 4.0 also allows HTML documents to be
embedded inline using the OBJECT element.
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1.
Required? No
Description:
This specifies the alignment of text following the FRAME reference
relative to the FRAME on the screen. LEFT and RIGHT alignment specify
floating horizontal alignment of the frame in the browser window, and
subsequent text in the document will wrap around the frame. The other
values specify vertical alignment of text relative to the frame on
the same line.
Description:
This attribute controls the background transparency of the IFRAME
element. If this attribute is false, the background color of the IFRAME
may only be that of the window. If the attribute is true, the background
color of the IFRAME may be set to any value, including transparent.
Values: False (DEFAULT)- IFRAME
is opaque and can not be made transparent. True - IFRAME may be any color, including transparent.
Description:
This attribute indicates whether or not the IFRAME content is an HTML
Application (HTA, a feature introduced in IE5), and is thus exempt from the
IE browser security model.
Values: No (DEFAULT)- Normal browser
security rules applied Yes - All IFRAME content is treated as an HTA, content is trusted
FrameBorder
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N6B1|O4]
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
This attribute gives the author the option of whether or not to have
a border around the frame.
Values: 1 [display border -
DEFAULT] 0 [display no border]
Height
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N6B1|O4]
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
This attribute explicitly specifies the height of the frame in pixels.
It can be used to speed up display of the document being downloaded so
it can pre-render the document without the frame while the frame
downloads.
Values:CDATA.
[Positive integer pixel values or integer values paired with a "%" character to denote
a percentage of the parent element height.]
Description:
This attribute specifies the horizontal spacing around the frame in pixels
(left and right padding.)
Values: Positive integers.
Longdesc
[2|3|3.2|4]
[X1|X1.1]
[IE|M|N|O]
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
This attribute specifies the URL of a longer description of the contents
of the IFRAME specified in the SRC attribute. This would allow long
passages of descriptive narrative with markup for the content of the IFRAME.
Values:CDATA.
[Either an absolute or relative URL. All URLs should be URL encoded where required.]
MarginHeight
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N6B1|O4]
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
This attribute specifies the horizontal spacing INSIDE the frame in pixels
(left and right padding.)
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
The optional Name attribute indicates the symbolic name assigned to
the current frame for reference by the browser when other links target
the frame as a destination. Default behavior for all FRAME documents
is to be unnamed. Named frames can serve as a destination of links via the
TARGET attribute within the
A, AREA,
BASE, and FORM tags.
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
This attribute provides guidelines for displaying a scrollbar in the
frame for the user.
Values: Auto [DEFAULT
- Let the browser decide if a scrollbar is necessary.] Yes [always provide a scrollbar] No [never provide scrollbar]
Src
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N6B1|O4]
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? Yes
Description:
This attribute represents the URL of the current frame document. An
IFRAME tag with no SRC attribute will display a blank space where
the iframe would be.
Values:CDATA.
[Either an absolute or relative URL. All URLs should be URL encoded where required.]
Description:
This attribute specifies the vertical spacing around the frame in pixels
(top and bottom padding.)
Values: Positive integers.
Width
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N6B1|O4]
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
This attribute explicitly specifies the width of the frame in pixels.
It can be used to speed up display of the document being downloaded so it
can pre-render the document without the frame while the frame downloads.
Values:CDATA.
[Positive integer pixel values or integer values paired with a "%" character to denote
a percentage of the parent element width.]
Example
<html>
<head>
<title>Floating frames
example</title>
</head>
<body>
<h1>This
is a floating frame example</h1>
<hr />
<iframesrc="http://www.foo.com/frame1.html"
name="float1" WIDTH="100"
height="100"
align="right">
You will not see this text if your browser supports
IFRAME. If you CAN see this, you are in a bad way.
</iframe>
<hr />
</body>
</html>
Use of frames of any type can involve a costly amount of extra
downloads that a user could quickly tire of.
[Test]
There appears to be different default interior padding values controlled
by the MARGINHEIGHT and MARGINWIDTH attributes. In other words, if only
one of these attributes is specified, the default for the unspecified
attribute will be different than the default for the attribute if
BOTH attributes are specified. [That looks confusing even
to ME =)] It is possible (though unverified) that in instances
where only one value is present it is used as the margin value for
BOTH dimensions.
The sample stylesheet for HTML 4 says that IFRAME should be considered
to be a "block" valued 'display' property, but in practice it behaves
like an "inline" type.
HTML 4.x+ recommends that authors use the ID attribute instead of the NAME
attribute wherever possible. ID is the accepted method moving forward and NAME will
eventually be removed.
Browser Peculiarities
Internet Explorer briefly flirted with a syntax for floating frames
using extensions to the FRAME element. This was changed to the IFRAME element
in 3.0 Beta 2 to allow for backward compatibility for non-supporting
browsers. When the old syntax is encountered in versions 3.0 Beta 2 and
greater, Internet Explorer gives a warning message that the syntax has changed.
[Test]
There is an attribute that Microsoft's references list for this
element called BORDER. It does appear to have some effect, but it appears
to be to render padding around the frame (which is what the HSPACE and
VSPACE attributes accomplish) instead of rendering a distinct border
around the frame.
Microsoft's references also list FRAMESPACING and NORESIZE as valid
attributes for this element, but these dynamic attributes do not appear
to have any effect. They also do not make sense given that an IFRAME
has a static size.
Opera 4 ships with IFRAME display capability turned off. To turn
this on, go to File...Preferences menu, select the Documents category.
Check the "Enable inline frames" box in the Frames section.