HTML <iframe> tag
The <iframe> tag is used to display an inline frame on a webpage in which you can display another page. With inline frames you can display one page within another.
Attributes
| Attribute | Description | Possible values |
|---|---|---|
| align | Deprecated. Sets the alignment of an iframe relative to what sorrounds it | left, right, top, middle, bottom |
| frameborder | Sets whether or not the iframe has a border | 0, 1 |
| height | Sets the height of the iframe | numericValue, % |
| longdesc | URL to a page that describes the contents of the iframe | theURL |
| marginheight | Sets an iframe's top and bottom margins | numericValue |
| marginwidth | Sets an iframe's left and right margins | numericValue |
| name | Sets an iframe's name | theName |
| scrolling | Sets whether or not an iframe can be scrolled | yes, no, auto (default behavior) |
| src | URL to load in the iframe | theURL |
| width | Sets the width of the iframe | numericValue, % |
Standard attributes
class, id, style, title
For more information on standard attributes, check out our HTML standard attributes reference page.
Event attributes
NONE
For more information on event attributes, check out our HTML event attributes reference page.
Example
<iframe src="http://www.yahoo.com" width="500" height="250" name="yahooFrame">
Your browser does not support iframes!!
</iframe>
Output:
Notes & tips
Place some content between the <iframe> and </iframe> tags that will be displayed if a browser does not support iframes. In the above example the text "Your browser does not support iframes!!" will be displayed in this situation.