W3Schools.com

HTML5 <iframe> Tag

Example

An inline frame is marked up as follows:

<iframe src="http://www.w3schools.com"></iframe>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <iframe> tag is supported in all major browsers.


Definition and Usage

The <iframe> tag specifies an inline frame.

An inline frame is used to embed another document within the current HTML document.


Differences Between HTML 4.01 and HTML5

HTML5 has some new attributes, and some HTML 4.01 attributes are not supported in HTML5.


Tips and Notes

Tip: Use CSS to style the <iframe> (even to include scrollbars).


Attributes

New : New in HTML5.

Attribute Value Description
frameborder 1
0
Not supported in HTML5
height pixels Specifies the height of an iframe
longdesc URL Not supported in HTML5
marginheight pixels Not supported in HTML5
marginwidth pixels Not supported in HTML5
name name Specifies the name of an iframe
sandboxNew ""
allow-forms
allow-same-origin
allow-scripts
allow-top-navigation
Enables a set of extra restrictions for the content in the iframe
scrolling yes
no
auto
Not supported in HTML5
seamlessNew seamless Specifies that the iframe should look like it is a part of the containing document
src URL Specifies the address of the document to embed in the iframe
srcdocNew HTML_code Specifies the HTML content of the page to show in the iframe
width pixels Specifies the width of an iframe

Global Attributes

The <iframe> tag also supports the Global Attributes in HTML5.


Event Attributes

The <iframe> tag also supports the Event Attributes in HTML5.


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