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


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.


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

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.




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).


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


Sets a margin of white space around the frame to the sides.


Sets a white-space margin to the top and bottom.


Adds a margin to the sides of the framed page.


Adds a margin to the top and bottom of the framed page.


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.

Ask Questions

Ask Question