Previous Next

HTML Iframes

<iframe> tag is used to show another HTML document anywhere within a region in HTML document.
It is used within body tag unlike <frameset>.
The src attribute is used to specify the URL of the document that occupies the inline frame.



Following is the example to show how to use the <iframe>:

<!DOCTYPE html>
<title>HTML Iframes</title>
<p>Document content goes here...</p>
<iframe src="" width="555" height="200">
   Sorry your browser does not support inline frames.
<p>Document content also go here...</p>


Document content goes here...

Document content also go here...




The <Iframe> Tag Attributes


Attribute Description

Specifies the url to load in frame.


This attribute allows you to give a name to a frame. 


Specifies whether or not the borders of that frame are shown.

It overrides the value given in the frameborder attribute on the <frameset> tag if one is given.


Specify the space between the left and right of the frame's borders and the frame's content. 


Specify the space between the top and bottom of the frame's borders and the frame's content. 


The noresize attribute prevents a user from being able to resize the frame. For example noresize="noresize".


Specify to show the scrollbar or not. It can values as "yes","no" or "auto".


Used to provide a link to another page containing a long description of the contents of the frame.

Example longdesc="framedescription.htm"

Previous Next