html tutorial - <iframe> Tag in HTML - html5 - html code - html form

iframe tag in html

Learn html - html tutorial - iframe tag in html - html examples - html programs

  • An <iframe> tag used to embed another page or document into the current HTML page.
  • We can use multiple Inline Frame in a single HTML page.
  • Each Inline Frame has its own session history and active documents.
  • <iframe> tag belongs to Flow content, phrasing content, embedded content, interactive content and palpable content.
  • <iframe> tag supports Global Attributes and Event Attributes.

Syntax for <iframe> tag:

<iframe src="URL"></iframe>

Sample Coding for <iframe> tag:

Tryit<!DOCTYPE html>
<html >
        <title>Wikitechy iframe tag</title>
        <iframe src=””>
            <p>Browser not Supported.</p>

Code Explanation for <iframe> tag:

<iframe> Tag Code Explanation

  1. <iframe> tag used to embed “” in the current HTML Page.

Output for <iframe> tag:

<iframe> Tag Output

  1. The output shows the ”” in the inline frame.

Attributes of <iframe> tag:

Attribute Value HTML4 HTML5 Description
align left
Yes No Specifies the alignment of an <iframe> according to surrounding elements.
frameborder 1
Yes No Specifies whether or not to display a border around an <iframe>.
height pixels Yes Yes Specifies the height of an <iframe>.
longdesc URL Yes No Specifies a page that contains a long description of the content of an <iframe>.
marginheight pixels Yes No Specifies the top and bottom margins of the content of an <iframe>.
marginwidth pixels Yes No Specifies the left and right margins of the content of an <iframe>.
sandbox allow-forms
No Yes Enables an extra set of restrictions for the content in an <iframe>
name text Yes Yes Specifies the name of an <iframe>
scrolling yes
Yes No Specifies whether or not to display scrollbars in an <iframe>
src URL Yes Yes Specifies the address of the document to embed in the <iframe>
srcdoc HTML_code No Yes Specifies the HTML content of the page to show in the <iframe>
width pixels Yes Yes Specifies the width of an <iframe>

Browser Support for <iframe> tag in HTML:

Yes Yes Yes Yes Yes

Related Searches to iframe tag in html