SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot ajaxdinesh's Avatar
    Join Date
    Apr 2009
    Location
    India
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Clarification frame and iframe?

    1. What is the difference between frame and iframe?
    2. Which one is best?
    3. Which situation we can use frame and iframe?
    4. These are deprecated tags?
    Cheers,
    Dinesh

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)
    A frame is part of a frameset, an iframe is an inline frame element.
    I think of a frameset as a kind of table layout, each frame being a part of a defined "grid", where iframes can be positioned using CSS

    Best? It depends on what you need. I think frames became popular for static pages before backend "includes" became widely used. That is, a page might have header, nav links, footer, and content frames, where the content frame changed so every "page" had the same header, nav links, and footer, without the need to recode them for multiple pages. You could do the same kind of thing with iframes if you wanted to.

    You can use frames if you use the frameset doctype, iframes anytime.

    I don't know the why behind frameset being deprecated, but iframe is deprecated in favor of using the object tag instead. The problem is that although iframe is deprecated, it's still widely supported, and personally I find the object tag a bit more trouble to work with (though I use neither).
    Last edited by Mittineague; May 21, 2009 at 19:32. Reason: typo

  3. #3
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Mittineague View Post
    I don't know the why behind frameset being deprecated, but frame is deprecated in favor of using the object tag instead.
    Well accessibility for one reason, the use of frames has been proven to make browsing the website on some devices as impossible, also having pages embedded inside pages... it also has a dark undertone of trying to cover up some potentially dangerous coding.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    With frames you need one more HTML page than you have frames - one to go in each frame and one to define the frameset that contains the frames. To do the same layout using iframes requires one less HTML page since the page containing the iframes can also contain the fixed part of what you want displayed.

    Basically anything that can be done with frames can also be done using iframes with using fewer files to define what to display.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All an iframe is, is an inline frame:

    Interesting article:
    http://techpatterns.com/web_design/f...s/overview.php

  6. #6
    SitePoint Zealot
    Join Date
    Feb 2009
    Location
    Baton Rouge, LA
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I personally wouldn't use frames anymore, it just seems outdated. Although it's easy to implement for a case where you have to load a document in a window that uses up the entire area as defined for that frame in a frameset. It can get tricky to get an iframe to use up the entire window height, because you have to dynamically determine what that height is at any given moment.

    With iframes, you can easily assign a fixed width/height if you want to just include the external document in a well-defined smaller area of the page.

    Iframes come in handy if you want to absolutely position different documents on top of each other and reveal them via tabs as needed for example to allow for quick switching between documents without reloading or relying on AJAX.

    Iframes are still more consistently supported than the object element and are not necessarily deprecated (only in strict DTD, but not transitional). Also, framesets are not deprecated either, they have their own DTD.
    "The browser is your first client" - Quote: Myself
    Please visit me at: vanillacloud.com

  7. #7
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    As per i know an inline frame is just a frame within a single page usually containing another page - it can exist without having a frame set defined and Frames are a bunch of 'boxes' put together to make one site with many pages....

    Thanks


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
  •