HTML iframes

HTML Iframe is used to display a nested webpage (a webpage within a webpage). The HTML

Here, "src" attribute specifies the web address (URL) of the inline frame page.

Set Width and Height of iframe

You can set the width and height of iframe by using "width" and "height" attributes. By default, the attributes values are specified in pixels but you can also set them in percent. i.e. 50%, 60% etc.

Example: (Pixels)

Test it Now

Example: (Percentage)

Test it Now

You can also use CSS to set the height and width of the iframe.

Example:

Test it Now

Remove the border of iframe

By default, an iframe contains a border around it. You can remove the border by using

This is a link below the ifarme click on link to open new iframe.


Embed YouTube video using iframe

You can also add a YouTube video on your webpage using the Test it Now

Output:

HTML iframes

Attributes of