Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 18-05-2009
Member
 
Join Date: Jan 2009
Posts: 39
How to use iFrame?

Hi,
I am currently working on one web site. I want some information on iFrame. What is it? and how to use iFrame? Please help.

All suggestions are welcome.
Reply With Quote
  #2  
Old 18-05-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: How to use iFrame?

IFrame is an HTML element which makes it possible to embed an HTML document inside another HTML document. Frames allow a visual HTML Browser window to be split into segments, each of which can show a different document. In HTML 4.01, a document may contain a header and a body or a header and a frameset, but not both a body and frameset. For frames the Frameset DTD must be used. iframe can be used in a normal document body.
Quote:
<frameset>?</frameset>
Delimits the frameset. The frames layout is given by comma separated lists in the rows and cols attributes.
Standardised in HTML 4.0 (Frameset DTD only); still current.
Quote:
<frame>?</frame>
Delimits a single frame, or region, within the frameset. A separate document linked with the src attribute appears inside.
Standardised in HTML 4.0 (Frameset DTD only); still current.
Quote:
<noframes>?</noframes>
Contains normal HTML content for user agents that don?t support frames.
Standardised in HTML 4.0 (Frameset and Transitional DTDs only); still current.
Quote:
<iframe>?</iframe>
An inline frame places another HTML document in a frame inside a normal (rather than frameset) HTML document.
First introduced by Microsoft Internet Explorer in 1997 and long only available in that browser, the iframe tag is now widely supported by visual browsers.
Unlike an object element, an inline frame may be the "target" frame for links defined in other elements and it may be "selected" by a browser as the focus for printing, viewing HTML source etc.
The <iframe> tag must be closed by </iframe>. Content between the <iframe> tags is used as alternative text to be displayed if the browser does not support iframes.
The iframe element is invalid in Strict DTDs, and in XHTML version 1.1.
Inline frames have, at times, been exploited to illicitly inject code into a web page.
Standardised in HTML 4.0 (Frameset and Transitional DTDs only); still current.
Reply With Quote
  #3  
Old 18-05-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: How to use iFrame?

An IFRAME is an HTML element whose content is determined by another file (usually an html file, but any valid web page URL). The content of that URL is displayed inside an inline frame, which is basically a rectangle (if you want to, you can think of it as a single cell table that gets it's content from another file).
Reply With Quote
  #4  
Old 18-05-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: How to use iFrame?

The IFRAME element defines an inline frame for the inclusion of external objects including other HTML documents. IFRAME provides similar functionality to OBJECT. One advantage of IFRAME is that it can act as a target for other links. However, OBJECT is included in HTML 4 Strict while IFRAME is not.
IFRAME's SRC attribute provides the location of the frame content--typically an HTML document. The optional NAME attribute specifies the name of the inline frame, allowing links to target the frame.
The content of the IFRAME element is used as an alternative for browsers that are not configured to show or do not support inline frames. The content may consist of inline or block-level elements, though any block-level elements must be allowed inside the containing element of IFRAME. For example, an IFRAME within an H1 cannot contain an H2, but an IFRAME within a DIV can contain any block-level elements.
The LONGDESC attribute gives the URI of a long description of the frame's contents. This is particularly useful for full descriptions of embedded objects. Note that LONGDESC describes the frame content while the content of the IFRAME element acts as a replacement when the external resource cannot be inlined.
For example:
Quote:
<IFRAME SRC="recipe.html" TITLE="The Famous Recipe">
<!-- Alternate content for non-supporting browsers -->
<H2>The Famous Recipe</H2>
<H3>Ingredients</H3>
...
</IFRAME>
The WIDTH and HEIGHT attributes specify the dimensions of the inline frame in pixels or as a percentage of the available space. The FRAMEBORDER attribute specifies whether or not a border should be drawn. The default value of 1 results in a border while a value of 0 suppresses the border.
Reply With Quote
  #5  
Old 18-05-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: How to use iFrame?

The <iframe> tag is used to insert an inline frame into the body of an HTML document. This is a very convenient method for inserting an HTML page inside another HTML page. Unlike the frameset, frame, and noframes tags, the iframe tag can only be used inside a body element. You must not place the iframe tag inside a frameset element. An iframe element displays content, including forms, images, multimedia, other frames, tables, etc. You can place a default textual message between the opening and closing iframes tags. This will only display if the browser does not recognize inline frames.
The align attribute is used to place the frame inline with adjacent text. The values bottom, middle, and top align the frame with the bottom, middle, and top of the text. The values right and left place the text on the right or left boundary and allow any text to flow around the frame.

The frameborder attribute is used to add or remove a border around the frame. The values of yes or 1 allow a border. The values of no or 0 forbid a border.

The longdesc attribute is the URL address of an HTML document that contains a long textual description of the frame. This is designed to provide more information than a title element would display.

The height attribute sets the vertical extent of the iframe in either pixels or as a percentage of the overall screen height.

The marginheight attribute is used to set the amount of white space in pixels that will appear along the top and bottom margins between the frame border and the contents. If you provide an unrealistic value, the browser will simply ignore this attribute.

The marginwidth attribute is used to set the amount of white space in pixels that will appear along the left and right margins between the frame border and the contents. If you provide an unrealistic value, the browser will simply ignore this attribute.

The name attribute is a string of characters that is used to label a frame with a name. The name must be unique to that document and cannot be reused.

The src attribute provides the URL address of any valid HTML, ASP, or other displayable page. The contents of the referenced URL will be displayed inside the frame.

The scrolling attribute is used to determine if horizontal and vertical scrolling bars will appear in the iframe. If the content is larger than the frame, this permits scrolling up and down or left and right, as needed, to see the entire contents. There are three permitted values: yes which always displays scroll bars; no which never displays scroll bars; and auto which displays scroll bars only when needed. If a value is not provided, the default is auto.

The width attribute sets the horizontal extent of the iframe in either pixels or as a percentage of the overall screen width.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to use iFrame?"
Thread Thread Starter Forum Replies Last Post
Link outside of an iframe Allison Software Development 5 07-01-2011 06:15 PM
What is Mal/Iframe-E? Hecter Networking & Security 4 04-02-2010 05:46 AM
How to redirect iframe in PHP Ground 0 Software Development 3 08-08-2009 01:01 PM
How to use Iframe tag in javascript Walter89 Software Development 3 30-06-2009 11:39 PM
No Border In iframe QUINEISHA Software Development 2 16-05-2009 01:04 PM


All times are GMT +5.5. The time now is 10:33 PM.