leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

HTML frame

Estimated reading: 2 minutes 33 views

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 properties are used to define the height and width of the iframe tag.

The property defaults to pixels, but you can specify it to be displayed proportionally (eg “80%”).

Example

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

iframe – remove border

The frameborder property is used to define whether or not to display the border of the iframe representation.

Set the property value to “0” to remove the iframe’s border:

Example

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

Use an iframe to display the target linked page

iframe can display a target linked 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://www.runoob.com " target=" iframe_a " rel=" noopener "> RUNOOB. com </a>
        </p> _

HTML iframe tag

LabelDescription
<iframe>define an inline (iframe)

Note

Because some pages do not want to be nested, there is an option in the response header

X-Frame-Options

He has three configurable values

DENY: Indicates that the page of this website is not allowed to be nested, even in the pages of its own domain name.
SAMEORIGIN: Indicates that the page can be displayed nested in pages of the same domain name.
ALLOW-FROM uri: Indicates that the page can be nested in the specified source page.

Leave a Comment

CONTENTS