HTML 4 iframe Tag
Also see HTML5 <iframe>
Tag.
This page is for the HTML 4 version of this element. For a more up to date version, see HTML5 <iframe>
Tag.
The HTML iframe
tag is used to specify an inline frame.
An inline frame allows you to embed another document within the current HTML document. You use the iframe src
attribute to specify the source of the other document, as well as other attributes to determine the height, width, scrolling properties, border etc.
Example
The above code produces the following inline frame:
Attributes
Attributes specific to this tag: | |
---|---|
Attribute | Description |
name | Assigns a name to a frame. This is useful for loading contents into one frame from another. |
longdesc | A long description - this can elaborate on a shorter description specified with the title attribute. |
width | Specifies the width of the inline frame. |
height | Specifies the height of the inline frame. |
Other Attributes: | |
Attribute | Description |
class | Document wide identifier. |
id | Document wide identifier |
title | Specifies a title to associate with the element. Many browsers will display this when the cursor hovers over the element (similar to a "tool tip"). |
style | Inline style (CSS) |
src | Location of the frame contents (for example, the HTML page to be loaded into the frame). |
scrolling | Whether the frame should be scrollable or not (i.e. should scrollbars appear). Possible values:
|
frameborder | Whether the frame should have a border or not. Possible values:
|
marginwidth | Specifies the margin, in pixels, between the frame's contents and it's left and right margins. |
marginheight | Specifies the margin, in pixels, between the frame's contents and it's top and bottom margins. |
align | For alignment. Possible values:
|
HTML5 Tags
The information on this page is based on HTML version 4.01. Most modern browsers now support HTML5.
See HTML5 <iframe>
Tag for the HTML5 version of the above element.
See this list of HTML tags for the latest list of HTML elements.