HTML <iframe> tag
You are Here:
HTML <iframe> tag
The <iframe>
tag is used to embed another document into the current HTML document.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<body>
<iframe src="/js">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Attributes
The following are the attributes of <iframe> tag. Also try Global attributes.
Attribute | Value | Explanation |
---|---|---|
height | px | Specifies the height of an <iframe>. |
name | text | Specifies the name of an <iframe>. |
referrerpolicy |
| Specifies whether or not to sent http referrer information. |
sandbox |
| Enables an extra set of restrictions for the content in an <iframe>. |
src | URL | Specifies the location (URL) of the document to be displayed inside an <iframe>. |
srcdoc | HTML_code | Specifies the inline HTML to embed in the <iframe>. |
width | px | Specifies the width of an <iframe>. |
Deprecated Attributes
The following attributes should not be used in any case.
Attribute | Value | Explanation |
---|---|---|
align |
| Specifies the alignment of the <iframe> concerning the surrounding context. |
frameborder | 1 or 0 | Specifies whether or not to draw a border around an <iframe>. |
longdesc | URL | Specifies a document which contains a long description of the content of an <iframe>. |
marginheight | px | Specifies the amount of space between the <iframe> content and its top and bottom borders. |
marginwidth | px | Specifies the amount of space between the <iframe> content and its left and right borders. |
scrolling |
| Specifies when the browser should provide a scroll bar to the <iframe> content. |
Reminder
Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in HTML.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.