Saturday 30 November 2013

HTML » iFrames

HTML iFrames


iFrames is used to display a page within a page.


Syntax:


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


You also have to set Width and Height.



» EXAMPLE:


<html>
<body>

</iframe>

</body>
</html>

» Result:





Use iframe as a Target for a Link

The target attribute of a link must refer to the name attribute of the iframe.

» EXAMPLE:

<html>
<body>

<iframe name="iframe_1">
</iframe>

<a href="http://easilylearnhtml.blogspot.com/2013/11/html-history.html" target="iframe_1">Easilylearnhtml</a>
<p>Click on the link to view the result.</p>

</body>
</html>

» Result:




Easilylearnhtml

Click on the link to view the result.
Because the target of the link matches the name of the iframe, the link will open in the iframe.

No comments:

Post a Comment