HTML IFrames

HTML IFrames

The iframe HTML is used for showing a web page in a web page.

It is also used for iframe full page, iframe video, example, alternative, map, refused to connect, responsive, iframe tag width, seamless and iframe tag not working

HTML Iframe Syntax

A inline frame is specified by the HTML iframe Tag.

A new document is integrated into the current HTML content using an inline frame.


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

Tip: Including a title attribute for the iframe is excellent practise. This is used to read the contents of the iframe by the display readers.

It is also used for what is the iframe and uses, iframe meaning, definition, alternative, embed code

Iframe - Set Height and Width

To specify the size of the iframe, use the height and width parameters.

Default pixels specify height and width:


<iframe src="html-resources/demo.htm" height="120" width="180" title="Iframe Example"></iframe>

Or you may add the CSS height and width features by using the style attribute:

<iframe src="html-resources/demo.htm" style="height:120px;width:180px;" title="Iframe Example"></iframe>

Result of the above query

It is also used for set iframe height 100, iframe adjust height to content, how to set iframe height and width dynamically angular in html, iframe auto height and width, resize content to fit iframe, iframe height responsive

Iframe - Remove the Border

An iframe has a border around it by default.

Add the style attribute and utilise the CSS border property for removing the border.


<iframe src="html-resources/demo.htm" style="border:none;" title="Remove Iframe Border"></iframe>

Result of the above query

The size, style and colour of the iframe border may also be changed with CSS:


<iframe src="html-resources/demo.htm" style="border:2px dotted red;" title="Iframe Example"></iframe>

Result of the above query

It is also used for iframe remove border and padding, iframe no border full page, an iframe has a border around it by default, how to remove iframe, iframe no border auto height

Iframe - Target for a Link

The target frame for a link can be an iframe..

The iframe's name attribute must be referenced by the link's target attribute::


<p><a href="" target="iframe_a">Load simmanchith homepage</a></p>
<iframe src="html-resources/demo.htm" name="iframe_a" title="Iframe Example" height="200" width="500"></iframe>

Result of the above query

It is also used for iframe link target parent, iframe link target-blank not working, iframe link target main window, iframe link target-self, iframe link target not working, anchor link target iframe