An inline frame is marked up as follows:
![]()
The <iframe> tag is supported in all major browsers.
The <iframe> tag specifies an inline frame.
An inline frame is used to embed another document within the current HTML document.
Tip: To deal with browsers that do not support <iframe>, place the text you want between the opening <iframe> tag and the closing </iframe> tag.
In XHTML, the name attribute of the <iframe> tag is deprecated, and will be removed. Use the id attribute instead.
DTD indicates in which HTML 4.01/XHTML 1.0 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 the content of an <iframe> | TF |
| marginwidth | pixels | Specifies the left and right margins of the content 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 address of the document to embed in the <iframe> | TF |
| width | pixels % |
Specifies the width of an <iframe> | TF |
The <iframe> tag supports the following standard attributes:
| Attribute | Value | Description | DTD |
|---|---|---|---|
| class | classname | Specifies a classname for an element | TF |
| id | id | Specifies a unique id for an element | TF |
| style | style_definition | Specifies an inline style for an element | TF |
| title | text | Specifies extra information about an element | TF |
More information about Standard Attributes.
According to the W3C, the <iframe> tag does not support any event attributes.
However, the onload event is supported in all browsers.
More information about Event Attributes.
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The CSS Certificate documents your knowledge of advanced CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|