Advanced Search

Results 1 to 8 of 8

Thread: iframe height 100% problem

  1. #1
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default iframe height 100% problem

    I am trying to get an iframe to size height to 100% but it keeps getting stuck on about 200 px in height. Also tried fx 80% with same result.

    Is it at all possible to set the height of an iframe dynamically?

    I have read quite a few comments about iframe such as "..dont use iframes..". Are these comments 'religious' or should I just avoid iframes for some reason?

    My goal is to navigate a site from a menu, each page being displayed in a target iframe. But since the pages differ in content I get scrollbars if they are too large. I would rather have the iframe scale to include all content.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    When you set the height of something to 100% it means that it will be 100% of the height of its container. It has nothing to do with the height of its content. There is a far from perfect script that you may or may not like for what you are doing:

    http://www.dynamicdrive.com/dynamici...iframessi2.htm

    Iframes should be avoided by anyone intending their pages to be 'future proof', as it is slowly being phased out of the standards. It will be around for quite some time yet to come, perhaps forever, but there is no guarantee. Because it is no longer being written into future standards, its behavior will most likely always be a bit quirky in different browsers.

    Personally, I have no problem with using it, but I recognize it is difficult to work with for the reasons just stated.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If you know the exact content you need to display on your page including dimensions in pixels you could insert it into an I-Frame and absolute position it :Left:0px;top:0px; using the following.....
    <div><iframe name=""src=""align=""frameborder="No" Scrolling="No"
    style="position:absolute;top:0px;left0px;width:??px; height:??px;z-index:1;">
    </iframe></div>

  4. #4
    Join Date
    Aug 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Global Moderator,

    You seem to know iframes and I have used them as the content display on my site mcgymswim.com. The only thing I have not been able to figure out is how to link topics to the iframe of the index pages when called from a link outside of the active directory. As an example, I would like to link the site map (located in Left Side Bar | Docs & Stuff | Web Site Map) to each topic in the assorted categories available in the left side bar menu.

    Help is much appreciated as I'm a web newbie and this is my first site.

    Regards - bsquared

  5. #5
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    81
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I have about the same problem with iframe

    I have a 3x3 table with rounded corners and i would like to put an iframe in de middle td. I used the script previously mentioned, but the td always stays the same height, although i set the height of the td to 100%.

    is there a way (script?) i can catch the height of the iframe and insert it in the table?

  6. #6
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have the same problem guys, I tried all the above codes , none working...

    any inputs..?

    Budiarto

  7. #7
    Join Date
    Oct 2005
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    try typiing in height="auto" and some browsers ignore auto and 100% like opera...
    Hey new design new look, goto xudas for personal webdsign help.. (:

  8. #8
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>iframe1</title>
    <style type="text/css">
    html{height:100%;}
    body{height:100%;}
    </style>
    </head>
    
    <body>
    <iframe src="http://www.google.com" height="100%" width="100%" frameborder="0">
    </body>
    </html>
    Last edited by jscheuer1; 07-08-2011 at 02:15 PM. Reason: format code

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
  •