By using the iframe frame, we can browse multiple pages in one browser window.
iframe syntax:
<iframe src="URL"></iframe>
The URL points to a different web page.
1. 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%").
Examples:
<iframe src="demo_iframe.htm" width="200" height="200"></iframe>
2. Iframe-remove the border
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>
3. Use iframe to display target link page
An iframe can display a page with a
target link. 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="http://www.runoob.com" target="iframe_a" rel="noopener">RUNOOB.COM</a></p>