HTML iframe tag

HTML <iframe> tag is an inline frame. It provides frame in a page to browse the content. Content may be a page, image or another website.

<iframe src="files/value.html" height="500px" width="500px">

Tag Uses

Specific uses of <iframe> tag

iframe is usually used to browse the content inside a frame.

Tag omission

Both starting and ending tags are necessary for the iframe element.

Global Attributes

All global attributes are applicable on the iframe element.

Tag Attributes

Attributes that are applicable to <iframe> tag

It represents the location of the resource.

<iframe src="Address of external resource" ></iframe>

It defines a name for the frame so that hyperlink may be browsed in this frame.

<iframe src="Location of external resource" name="unique name"></iframe>

It specifies security rules for the content inside frame.

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

It defines the horizontal dimension of iframe.

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

It defines the vertical dimension of iframe.

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

Was this article helpful?