codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:



Home » HTML » Article

HTML IFrames (In-Line Frames)

Article by:  Jeff Anderson  ( 1362 ) (1/24/2002)
Bookmark us now! Add to Favourites
Email a friend!Tell a friend
Summary: Inline frames or IFrames are the ones which appear in the midst of a standard page, but actually reference a totally separate url.
Viewed: 64642 times Rating (76 votes): 
 2.5 out of 5
 Rate this Article  Read Comments  Post Comments




HTML IFrames (In-Line Frames)


Inline frames are the ones which appear in the midst of a standard page, but actually reference a totally separate url. Here's the home page of CodeToad for you:



Here's the simple code to do that :

<IFRAME SRC="http://www.codetoad.com" WIDTH="70%" HEIGHT="90"></IFRAME> 


I heard IFrames only work in IE. Is this true?

In-Line Frames are a feature of Internet Explorer version 3.0 and above. Netscape 4 will not display them, a fact which you can work around by inserting alternative content immediately before the closing </FRAME> tag. They do however work in netscape 6, and as a feature of the HTML 4.0 standard, ought these days to be acceptable.

Other attributes

As with standard frames, you can have all the usual attributes :

FRAMEBORDER=0; MARGINWIDTH=0; MARGINHEIGHT=0; SCROLLING="no";

as well as attributes more commonly associated with images and tables:

ALIGN="right";
HSPACE="5" ;
VSPACE="5" (these last two determine margin of white space around the frame)






CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
Rate this article:     Poor Excellent
View highlighted Comments
User Comments on 'HTML IFrames (In-Line Frames)'
Posted by :  Archive Import (Clark Alegata) at 22:10 on Tuesday, February 04, 2003
hey! this is some good stuff. I was wondering though, how do i make a table with that scroll bar on it. The thing is, does it have to be a source. I don't want it to link to anything. I just want it my front page. Please e-mail me back.. I've trying to figure it out and I also tried this one but then it keeps showing that ERROR thing like with that refresh button thing..
Posted by :  Archive Import (syscrash2k) at 18:05 on Monday, March 10, 2003
Good tutorial. I was wondering how i could do something like that. Good work :)
Posted by :  Archive Import (mouse) at 11:30 on Wednesday, March 12, 2003
erm i have a tag board and i was wondering how i could insert it into an iframe? plz help me
Posted by :  Archive Import (Aiza) at 20:03 on Sunday, March 16, 2003
Thanks so much! This is very informative and helpful.
Posted by :  Archive Import (Chris) at 05:43 on Thursday, March 20, 2003
Thanks for the info! I don't see a whole lot of good stuff written on iframes.

Has anyone tried putting an iframe on the same page as a flash movie? I have the two separated into different table cells but they are sitting on top of each other.
Posted by :  Archive Import (Jake) at 20:33 on Wednesday, April 02, 2003
Is there anyway to break out of an Iframe because I put a link in one and I want that link to go to a regular browser!
Posted by :  Archive Import (loclah0s7) at 21:56 on Tuesday, April 08, 2003
thank u guys very much for the align="position" tag for the iframes, helped out alot, thanks again.
Posted by :  Archive Import (Monkee) at 10:24 on Thursday, April 10, 2003
You guys REALLY helped me on this! I've been looking all over for this html code! THANX!!!!!!!!!!!!!!!!
Posted by :  Archive Import (Lisa) at 20:32 on Tuesday, April 22, 2003
I want to ahve two iframes on ym site but have on iframe in the top left corner and the other in the bottom right... how can i do this?
Posted by :  Archive Import (rookiebabe) at 18:25 on Sunday, May 04, 2003
I was wondering if anyone could answer my question. When you have an iframe how do you make it so that when you click on a link, the inline frame changes to another page, instead just the whole page changing?
Posted by :  Archive Import (Ian) at 20:42 on Monday, May 19, 2003
To Change the contents in the IFRAME or main page, use TARGET / NAME combination just like standard frames. I did it for a CD autorun menu.
Posted by :  Archive Import (Byrav) at 12:58 on Tuesday, May 27, 2003
i was wondering if there was a way to align the ifrma on the bottom of the page.
Posted by :  Archive Import (joe rehall) at 01:34 on Friday, June 27, 2003
Is there anyway to break out of an Iframe because I put a link in one and I want that link to go to a full screen browser. please please email me with an answer, thanks!
Posted by :  Archive Import (Orfos) at 02:56 on Friday, July 18, 2003
AHHH This is driving me crazy. I have 2 iframes on my site. I need a link inside one iframe to change the page in the second iframe. Does anyone know how to do this??
Posted by :  Archive Import (Mike Trionfo) at 01:20 on Saturday, July 26, 2003
In the page that owns the two iframes, put a name on each iframe.

Then, inside the iframe that has a link or a tag that needs to change the other iframe when it is clicked on, put a target="name_of_other_iframe" in the <a> tag.
Posted by :  Archive Import (kelv) at 03:59 on Sunday, July 27, 2003
Hey is it possible 2 position da -frames anywhere u want? if so how do u do it in dreamweaver mx?

thanx =)
Posted by :  Archive Import (Somedude) at 21:47 on Tuesday, August 19, 2003
Anyone know how to put a basic border (like a picture) on the IFrame?

E-mail me at nick_od_20@hotmail.com if you do.

<iframe src="yourpage.htm" name="frame1">

In your other frame, the page that has the link you want in the other IFrame, put this...

<a href="link.htm" target="frame1">

If you want it in a new browser window then do this:

<a href="link.htm" target="_blank">
Posted by :  Archive Import (Chris) at 15:13 on Thursday, August 21, 2003
I am trying to use iframes to populate rows in a HTML table - so each table record is an iframe - how do I get the formatting correct to allow me to use individual iFrames as records in the HTML table?

(Right now, my code is putting the iFrame on top of the table headers)
Posted by :  Archive Import (Dave) at 08:36 on Saturday, August 23, 2003
Hi

How do you vertically align iframes? I tried adding valign as I would in a table but didn't work. Any thoughts?
Posted by :  Archive Import (Jan) at 12:32 on Tuesday, August 26, 2003
I have an iframe on my site. Right now, I have test linking to my iframe pages. What I would like is to click onto a graphic, for instance buttons I have created, instead of text to change the iframe pages. Is this possible?
Posted by :  Archive Import (Rashid Online) at 18:12 on Thursday, August 28, 2003
Thanks,that's what I want.
Posted by :  Archive Import (Dave) at 12:14 on Friday, August 29, 2003
Jan in your iframe tag enter this

name="rename this"

where it says rename this rename it to what you like like maybe framr or target or something that represents this location then in the link tags for your images enter this after the URL for your image

target="rename this"

And make sure the rename this matches the name you give your iframe this should work for targeting this frame.
Posted by :  Archive Import (Dave) at 12:17 on Friday, August 29, 2003
Jan just realized I made a slight mistake. The second part put that in your link tag not your image tag so it will look something like this

<a href="URL" target="frames name">text or image code used for link</a>
Posted by :  Archive Import (gspat) at 14:25 on Tuesday, September 02, 2003
Is there an easy way to send form data from a webpage into an iframe on the same page?
Posted by :  Archive Import (Sanne) at 22:37 on Saturday, September 06, 2003
how do i put an iframe over my image? i can't find a code that would let me do that. please help me...<3 sanne
Posted by :  Archive Import (Ralph) at 04:22 on Tuesday, September 16, 2003
If you want to open a new screen if you click on a link simply add this code to your link.

<a href="link.html" target="_blank">Name Link</a>
Posted by :  criticalj at 18:45 on Wednesday, January 07, 2004
to sanna or anyone who wants to move the iframe over anything...

add this style command to the end of the iframe tags. (this will move the iframe from its origanal place and move it -100 pixels up and 10 pixels to the left)

style="position:absolute;Left:10(amount to move left);Top:-100(amount from top)"

change the left and top number to the amount you want to move it.

eg.

<img src="image.jpg" width="100" height="100">

<br>

<iframe src="theiframe.html"

height="50" width="50"

style="position:relative;Left:15;Top:-100">

</iframe>



da!dar! the iframe is now over the image :D
Posted by :  criticalj at 18:55 on Wednesday, January 07, 2004
ooops i made a mistake... where it says "position:absolute" it sould be "position:relative" (if you use absolute it will position it from the top corner of the page instead of its origanal place)

and i meant to say to Sanne
Posted by :  kilteer at 14:59 on Wednesday, January 21, 2004
Is there a way to make the iframe used as a background? Or possibly transparent upon failure. Such that if the target of the iframe (in the case I'm using pointing to an ASP page) fails to load, you would see what is underneath rather than the standard Page Not Found.

Posted by :  kitzu at 08:12 on Thursday, March 04, 2004
thanks for posting all the info guys.^_^ reading your posts really helped me a lot.^_^
Posted by :  Wizard at 21:26 on Saturday, November 20, 2004
I am using Dreamweaver and hava a flash button. How do I make the button into a link that will load the page in m iframe?


Thanks in advance:)


To post comments you need to become a member. If you are already a member, please log in .

 



RELATED ARTICLES
Image Submit Button
by Jeff Anderson
You can keep your forms from slipping into mundanity by substituting the default gray submit button to a colourful graphic of your choosing.
Parent _self _blank and _top Frame Target Specifications
by Jeff Anderson
How to specify frames and how to break out of them using standard link tags.
Pre Tag
by Jeff Anderson
No need to reformat text files with line breaks and tabs if you use the pre tag
Image Rollovers
by Jeff Anderson
A bit of code to swap to different images on the page. You often see this on sites to display a rollover on the navigation buttons.
ASCII characters and their codes
by Jeff Anderson
A full list of all the ASCII characters.
In-Line Frames (IFrames)
by Jeff Anderson
Inline frames or IFrames are the ones which appear in the midst of a standard page, but actually reference a totally separate url.
Validate Date
by Kannadasan Ramiah
Validating Date entered in a text box, pure HTML page
HTML Hspace and Vspace Image Borders
by Jeff Anderson
A lesser known feature in HTML is the ability to add a blank border around images both horizontally and vertically.
Creating Navigation with Frames
by Jeff Anderson
The most popular use of frames is to allow a static navigation to stay on one part of the screen (in one frame) while the content changes in another.
The OSI Reference Model - A Clear and Concise Illustration !
by James Opiko
The OSI Reference Model - A Resource For IT Certification Candidates & Networking Professionals








Recent Forum Threads
• C++
• Re: refresh parent after closing pop up window
• Dynamic Insertion
• Date and Time function around the world???
• Significant Factors
• Perl array access
• Re: huffman encoding and decoding in C++...
• Perl One Liner: Replace {(
• Re: html including php, accessing the functions


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009