Iframe displays a webpage within a webpage. You can include it in your HTML page using ‘iframe’ tag.
Checkout the syntax below.
It’s pretty simple to do that. Also, you can set width and height for the webpage inside. Let’s see how.
/* OR */ /* OR */
As you can see there are more than one way to set the width and height of any element. You can use pixels(px) directly to specify the height and width or you can use percentage directly. Also, you can use inline CSS code or a separate CSS file with same code as inline.
One more thing you can do is adding border to make it look real nice with a border frame.
/* OR- in case you don’t want any border then */
You have to specify border width in order to add a border for e.g. 2px solid black otherwise browser won’t add any borders.
There is one more interesting fact about the iframe which you can go for and users might love it as well. Look at the code below.
As you can see, we can use iframe as a target frame of a link. The only condition is it must refer to the name of the iframe.