HTML Frame

By using frames, you can display more than one page in the same browser window.

iframe syntax:

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

The URL points to a different web page.

Iframe-set height and width

The height and width attributes are used to define the height and width of the iframe tag.

The attribute is in pixels by default, but you can specify that it is displayed proportionally (for example: “80%”).

Example

<iframe src="demo_iframe.htm" width="200" height="200"></iframe>

Iframe-remove the frame

The frameborder attribute is used to define whether the iframe indicates whether to display a border.

Set the attribute value to “0” to remove the border of the iframe:

Example

<iframe src="demo_iframe.htm" frameborder="0"></iframe>

Use iframe to display target link page

iframe can display a target link page

The attributes of the target link must use the attributes of the iframe, as in the following example:

Example

<iframe src="demo_iframe.htm" name="iframe_a"></iframe>
<p><a href="https://hackerthink.com" data-et-target-link="iframe_a" rel="noopener">HackerThink</a></p>

HTML iframe tag

Label Description
<iframe>
Define an inline iframe