Description

The <iframe> (short for inline frame) tag defines an inline frame that contains external objects including other web page.

The following table summarizes the usages context and the version history of this tag.

Placement:Block
Content:Any block, inline, and text
Start/ End Tag:Start tag: required, End tag: required
Version:HTML 4 and 5

Syntax

The basic syntax of the <iframe> tag is given with:

HTML/XHTML: <iframe src="URL" scrolling="auto|no|yes"> ... </iframe>

The example below shows the <iframe> tag in action.

<iframe src="hello.html" width="400" height="300"
    scrolling="auto">
    <p>[Your browser does not support frames or is currently configured not to display frames. However, you may visit <a href="optional.html">the related document.</a>]</p>
</iframe>

Tag-Specific Attributes

The following table shows the attributes that are specific to the <iframe> tag.

Global Attributes

Like all other HTML tags, the <iframe> tag supports the global attributes in HTML5.

Event Attributes

The <iframe> tag also supports the event attributes in HTML5.

Browser Compatibility

Element
<iframe>YesYesYesYesYes