CARVIEW |
HTML Tutorial
HTML HOME HTML Introduction HTML Editors HTML Basic HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Styles HTML Formatting HTML Quotations HTML Comments HTML Colors HTML CSS HTML Links HTML Images HTML Favicon HTML Page Title HTML TablesHTML Forms
HTML Forms HTML Form Attributes HTML Form Elements HTML Input Types HTML Input Attributes Input Form AttributesHTML Graphics
HTML Canvas HTML SVGHTML Media
HTML Media HTML Video HTML Audio HTML Plug-ins HTML YouTubeHTML APIs
HTML Web APIs HTML Geolocation HTML Drag and Drop HTML Web Storage HTML Web Workers HTML SSEHTML Examples
HTML Examples HTML Editor HTML Quiz HTML Exercises HTML Website HTML Syllabus HTML Study Plan HTML Interview Prep HTML Bootcamp HTML Certificate HTML Summary HTML AccessibilityHTML References
HTML Tag List HTML Attributes HTML Global Attributes HTML Browser Support HTML Events HTML Colors HTML Canvas HTML Audio/Video HTML Doctypes HTML Character Sets HTML URL Encode HTML Lang Codes HTTP Messages HTTP Methods PX to EM Converter Keyboard ShortcutsHTML Iframes
An HTML iframe is used to display a web page within a web page.
HTML Iframe Syntax
The HTML <iframe>
tag specifies an
inline frame.
An inline frame is used to embed another document within the current HTML document.
Syntax
<iframe src="url" title="description"></iframe>
Tip: It is a good practice to always include a
title
attribute for the <iframe>
.
This is used by screen readers to read out what the content of the iframe is.
Iframe - Set Height and Width
Use the height
and width
attributes to specify the
size of the iframe.
The height and width are specified in pixels by default:
Example
<iframe src="demo_iframe.htm" height="200" width="300"
title="Iframe Example"></iframe>
Try it Yourself »
Or you can add the style
attribute and use
the CSS height
and width
properties:
Example
<iframe src="demo_iframe.htm" style="height:200px;width:300px;"
title="Iframe Example"></iframe>
Try it Yourself »
Iframe - Remove the Border
By default, an iframe has a border around it.
To remove the border, add the style
attribute and use the CSS
border
property:
Example
<iframe src="demo_iframe.htm" style="border:none;"
title="Iframe Example"></iframe>
Try it Yourself »
With CSS, you can also change the size, style and color of the iframe's border:
Example
<iframe src="demo_iframe.htm" style="border:2px solid red;"
title="Iframe Example"></iframe>
Try it Yourself »
Iframe - Target for a Link
An iframe can be used as the target frame for a link.
The target
attribute
of the link must refer to the name
attribute of the iframe:
Example
<iframe src="demo_iframe.htm" name="iframe_a" title="Iframe
Example"></iframe>
<p><a href="https://www.w3schools.com" target="iframe_a">W3Schools.com</a></p>
Try it Yourself »
Chapter Summary
- The HTML
<iframe>
tag specifies an inline frame - The
src
attribute defines the URL of the page to embed - Always include a
title
attribute (for screen readers) - The
height
andwidth
attributes specify the size of the iframe - Use
border:none;
to remove the border around the iframe
HTML iframe Tag
Tag | Description |
---|---|
<iframe> | Defines an inline frame |
For a complete list of all available HTML tags, visit our HTML Tag Reference.
Video: HTML Iframe


Contact Sales
If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com
Report Error
If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com
Top Tutorials
HTML TutorialCSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial
Top References
HTML ReferenceCSS Reference
JavaScript Reference
SQL Reference
Python Reference
W3.CSS Reference
Bootstrap Reference
PHP Reference
HTML Colors
Java Reference
Angular Reference
jQuery Reference
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.
Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.