English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The HTML <iframe> tag allows you to embed another HTML page into the current page. This tag is also commonly referred to as the <iframe> element.
Mark an inline frame:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Basic Tutorial(oldtoolbag.com)</title> </head> <body> <iframe src="//www.oldtoolbag.com"> <p>Sorry, your browser does not support iframe </p> </iframe> </body> </html>Test to see ‹/›
If the browser does not support the <iframe> tag, it will display the text 'Sorry, your browser does not support iframe' as an alternative.
IEFirefoxOperaChromeSafari
All major browsers support the <iframe> tag.
<iframe> tag defines an inline frame.
An inline frame is used to embed another document within the current HTML document.
Within the frame, scripts can use window.parent to refer to the parent window.
Tip:You can place the required text between <iframe> and </between <iframe> tags, so that it can handle browsers that do not support <iframe>.
Tip:Use CSS to define styles for <iframe> (including scrollbars).
HTML5 New properties have been added, and some have been removed in HTML 4.01 Some properties.
In XHTML, the name attribute has been deprecated and will be removed. Please use the id attribute instead.
New : HTML5 New attribute added to the .
Attribute | Value | Description |
---|---|---|
align | left right top middle bottom | HTML5 Not supported. HTML 4.01 Deprecated. Define how to align the <iframe> relative to the surrounding elements. |
frameborder | 1 0 | HTML5 Not supported. Define whether to display a border around the <iframe>. |
height | pixels | Specify the height of the <iframe>. |
longdesc | URL | HTML5 Not supported. Define a page that contains a longer description of the <iframe>. |
marginheight | pixels | HTML5 Not supported. Specify the top and bottom margins of the <iframe>. |
marginwidth | pixels | HTML5 Not supported. Specify the left and right margins of the <iframe>. |
name | name | Specify the name of <iframe>. |
sandboxHTML5 | "" allow-forms allow-same-origin allow-scripts allow-top-navigation | Define a series of additional restrictions on the content of <iframe>. |
scrolling | yes no auto | HTML5 Not supported. Specify whether to display scrollbars in the <iframe>. |
seamlessHTML5 | seamless | Specify that the <iframe> appears to be part of the parent document. |
src | URL | Specify the URL of the document displayed in the <iframe>. |
srcdocHTML5 | HTML_code | Specify the HTML content displayed in the <iframe> on the page. |
width | pixels | Specify the width of <iframe>. |
Supports <iframe> tag Global Attributes of HTML.
Supports <iframe> tag HTML Event Attributes.
HTML Tutorial:HTML Frames
HTML DOM Reference Manual:IFrame Object