HTML Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
HTML Basic
Introduction
How To
HTML Tags
html, head, body
Text Manipulation
IMAGES
Special Effects
Using Tables
Forms
Other Topics
 


ADVANCED HTML
Introduction
Media
Meta Tag
Frame tags
Fieldset
Tooltip
DTD
Image tags
Subscript & Superscript
Bullet styles
Canvas
Other tags
Ask Your Doubts
More about HTML
Feedback
 




IFrame


Tutorials Tutorials

Topic

I want to use inline frames in my page, how to use iframe in my webpage?



Explanation

Inline Frames/Iframe are a great implementation of the frames idea which allows you to open new pages properly inside the main page. This tag allow you to create a frame that can appear anywhere within a standard html document. Inline or 'floating' frames are one's which appears on a page, much like an image or a table would. This allows you to open complete separate pages in the middle of your writing. Here's a simple example of an inline frame.

Example:

<html>
<body>
<iframe src="http://www.indiandir.com" height="20%" width="70%">
</iframe>
</body>
<html>

The width and height attribute allows you to define the width and height of the frame and it can be given in pixel or percentage. The src attribute is used to define the source html document for the floating frame.

Note: The inline frames are only supported by Internet Explorer 4, so if you have a large audience of people using Netscape, you may want to stay away from it. However other browsers will simply ignore this tag.

Result:



Attributes:
frameborder="0"
Setting the border to 0 gets rid of it, allowing the page to seamlessly integrate with your main page. Possible values are 1 (yes) and 0 (no).

align="right"
Like the image attribute, this will affect how the text around the frames align itself.

hspace="x"
Sets a margin of white space around the frame to the sides.

vspace="x"
Sets a white-space margin to the top and bottom.

marginwidth="x"
Adds a margin to the sides of the framed page.

marginheight="x"
Adds a margin to the top and bottom of the framed page.

scrolling="no"
This attribute makes the scrollbar disappears.
We can place the iframe with scroll anywhere in the html document whereas the ordinary frame cannot be placed as we wish in the web pages. This makes a big difference between ordinary frame and the inline frame and hence inline frames are prefered mostly than frameset.




Other Links

web hosting