Results 1 to 5 of 5

Thread: How to use iFrame?

  1. #1
    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.

  2. #2
    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.
    <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.
    <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.
    <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.
    <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.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

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

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

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

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    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.

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,658,379.74255 seconds with 17 queries