THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML Iframes


iframe is use to display a web page within web page .



Iframe Syntax

The syntax for adding an iframe is:

<iframe src="URL"></iframe>

The src attribute specifies web address of the iframe page.


Iframe - Set Height and Width

we are use adjust height and width attributes to size.

The attribute values are specified in percent and can be pixel.

Example

<iframe src="check_iframe.htm" width="100" height="100"></iframe>

Iframe - Remove the Border

when by default then iframe has black border around it.

we can remove border, by adding style of attribute and css property

.

Example

<iframe src="check_iframe.htm" style="border:none"></iframe>

conclusion we can change color & style size of the iframe border.

Example

<iframe src="CHECK_iframe.htm" style="border:5px dotted red"></iframe>

Use iframe as a Target for a Link

An iframe can be used as the target frame for a link.

The target attribute of the link must refer to the name attribute of the iframe:

Example

<iframe src="demo_iframe.htm" name="iframe_a"></iframe>
<p><a href="http://www.welookups.com" target="iframe_a">welookups.com</a></p>
Try it Yourself »

HTML iframe Tag

Tag Description
<iframe> Defines an inline frame