HTML iframe 📌


An HTML iframe is used to display a web page within a web page.


Preview

This how iframe work. Also it can help you to understand visual of iframe.

 

How does it work? 🤔

In order to use this, we need to know something. This is inline frame
An inline frame is used to embed another document within the current HTML document.

Syntex

                
<iframe src="url" title="description"></iframe>
            

Tips: It is a good practice to always include a title attribute for the <iframe>. This is used by screen readers to read out what the content of the iframe is.

Iframe - Set Height and Width

Use the height and width attributes to specify the size of the iframe. Or you can add the style attribute too.

                
<iframe src="url.htm" style="height:200px;width:300px;" title="Iframe Example"></iframe>
            

That's all for this. See you in next one.