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.

 

Example

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

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

Result:

Document content goes here...

Document content also go here...

 


 

 

The <Iframe> Tag Attributes

 

Attribute Description
src

Specifies the url to load in frame.

name

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

frameborder

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.

marginwidth

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

marginheight

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

noresize

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

scrolling

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

longdesc

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

Example longdesc="framedescription.htm"



Previous Next