HTML <iframe> Tag
Example
An inline frame is marked up as follows:
<iframe src ="html_intro.asp"
width="100%" height="300">
<p>Your browser does not support iframes.</p>
</iframe> |
Try it yourself » |
Definition and Usage
The <iframe> tag defines an inline frame that contains another document.
Browser Support

The <iframe> tag is supported in all major browsers.
Differences Between HTML and XHTML
The iframe element is not supported in HTML 4.1 Strict DTD and in XHTML 1.0 Strict DTD.
Tips and Notes
Tip: To deal with browsers that do not understand iframes, place the text you want between the opening <iframe> tag and the closing </iframe> tag.
Optional Attributes
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
| Attribute |
Value |
Description |
DTD |
| align |
left
right
top
middle
bottom |
Deprecated. Use styles instead. Specifies the alignment of an iframe according to surrounding elements |
TF |
| frameborder |
1
0 |
Specifies whether or not to display a border around an
iframe |
TF |
| height |
pixels
% |
Specifies the height of an iframe |
TF |
| longdesc |
URL |
Specifies a page that contains a long description of the
content of an iframe |
TF |
| marginheight |
pixels |
Specifies the top and bottom margins of an iframe |
TF |
| marginwidth |
pixels |
Specifies the left and right margins of an iframe |
TF |
| name |
name |
Specifies the name of an iframe |
TF |
| scrolling |
yes
no
auto |
Specifies whether or not to display scrollbars in an iframe |
TF |
| src |
URL |
Specifies the URL of the document to show in an iframe |
TF |
| width |
pixels
% |
Specifies the width of an iframe |
TF |
Standard Attributes
The <iframe> tag supports the following standard attributes:
| Attribute |
Value |
Description |
DTD |
| class |
classname |
Specifies a classname for an element |
STF |
| id |
id |
Specifies a unique id for an element |
STF |
| style |
style_definition |
Specifies an inline style for an element |
STF |
| title |
text |
Specifies extra information about an element |
STF |
More information about Standard Attributes.
Event Attributes
The <iframe> tag does not support any event attributes.
More information about Event Attributes.

The Altova MissionKit, recent winner of the Jolt Product Excellence and Productivity Award for Best Development Environment,
is an integrated suite of tools ideal for:
- XML development
- Web & Web services development
- Data mapping & integration
- Rendering & publishing XML & database data
- XBRL validation, taxonomy editing, transformation & rendering
The MissionKit for XML Developers includes XMLSpy®, MapForce®, and StyleVision® plus 3 additional tools for less than the price of 2.
Try all 6 products free for 30 days!
Download a fully-functional free trial
|
|
|
|