Results 1 to 26 of 26

Thread: (HTML & CSS) Can I set an iframe to fill all available space? **Resolved**

  1. #1

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057

    (HTML & CSS) Can I set an iframe to fill all available space? **Resolved**

    Can I set an iframe to fill all available space? Like height="*"?
    Michael
    Last edited by msimmons; Dec 16th, 2002 at 06:21 PM.
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I don't know how well supported it is, but in IE6, this works:

    Code:
    <iframe style="height: 100%; width: 100%;"></iframe>
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Does that tell it to be 100% of the container (in this case the page) or to fill the available space? I think it is the first one cos its going off the page now.
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  4. #4

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057

    **Bump**

    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  5. #5
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    It doesn't go off the page for me, man. Do you have it nested in another tag, like a <div>?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  6. #6

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    No but I have something above it. This code:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </HEAD>
    <BODY>
    <img src="filler" height="50">
    <iframe style="height: 100%; width: 100%;"></iframe>
    </BODY>
    </HTML>
    will give it exactly 50px of scroll bar.
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  7. #7
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    oh. damn
    My evil laugh has a squeak in it.

    kristopherwilson.com

  8. #8

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    yup
    I did workaround the problem with the page i was having this time but would like to know in the future so I can get away from framsets
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  9. #9
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    have you tried nesting it in a div and setting width and height to 100%?

    Also, replace <img src="filler" height="50"> with a div, it should speed up rendering. <div style="width:100%; height:50%;">
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  10. #10

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    nesting didn't work
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </HEAD>
    <BODY>
    <img src="filler" height="50">
    <div style="height: 100%; width: 100%;">
    	<iframe style="height: 100%; width: 100%;"></iframe>
    </div>
    </BODY>
    </HTML>
    Sorry to be dense but I don't understand what you mean about the image.
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  11. #11
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Try this:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </HEAD>
    <BODY>
    <div style="height: 100%; width: 100%;">
      <div style="height:50%; width:100%;"></div>
      <iframe style="height: 50%; width: 100%;"></iframe>
    </div>
    </BODY>
    </HTML>
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  12. #12

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    that dosen't give scrollbars because the totals equal 100%. The situation I have is that the page is completely dynamic based on querystring perameters [sic]. The way it is now is, sometimes I have a graphic heading (different ones of different sizes) and sometimes not, then a frame that is a fixed size, then a frame that I need as big as possible but I never know how much room I have. thats why I am using frames now cos of the "*" feature but it still isn't what I want.
    thanks
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  13. #13
    Lively Member jamieoboth's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    116
    umm.m... dont use 'style'. I dont.

    Just use <Iframe src="whatever" width="100%" height="100%">


    lol works ok on my site, Mike. You just helped me with it


    James
    Ich widerstehe allem - nur nicht der Versuchung

    (I can resist anything but temptation)

  14. #14

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Originally posted by jamieoboth
    umm.m... dont use 'style'. I dont.

    Just use <Iframe src="whatever" width="100%" height="100%">


    lol works ok on my site, Mike. You just helped me with it


    James
    Still doesn't work.
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  15. #15
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by jamieoboth
    umm.m... dont use 'style'. I dont.
    Just because you practice bad coding standards doesn't mean that others should as well. Try running that code through a validator and see what happens.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  16. #16
    Lively Member jamieoboth's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    116
    lol fine. It was just a suggestion mate... jesus....
    Ich widerstehe allem - nur nicht der Versuchung

    (I can resist anything but temptation)

  17. #17
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    try using the following code in your <body> tag:

    Code:
    topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0"
    it will stop IE adding its margin to the page
    and hopefully make the width & height propa
    Wayne

  18. #18

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    still wont work
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  19. #19
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by jamieoboth
    lol fine. It was just a suggestion mate... jesus....
    No need to bring religion into this.

    Would you tell a man building a house to use Elmer's Glue when he can't find nails? If you're a lunatic, maybe. So don't tell someone to use bad coding practices either.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  20. #20
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    You probably don't want tables as your answer, but I think this is valid HTML. I've only tried it in IE 5.5, though:

    Code:
    <html>
    <head>
        <title>blah</title>
    </head>
    <body>
        <table style="border: 1px solid black; width: 100%; height: 100%;">
            <tr>
                <td><img src="filler" height="120"></td>
            </tr>
            <tr>
                <td style="height: 100%;">
                    <iframe src="blah" style="width: 100%; height: 100%;"></iframe>
                </td>
            </tr>
        </table>
    </body>
    </html>
    My evil laugh has a squeak in it.

    kristopherwilson.com

  21. #21

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Originally posted by The Hobo
    You probably don't want tables as your answer...
    Whatever works... and that worked Thanks!
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  22. #22
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    nuva idea:

    I checked my site on an html validator, and topmargin="0" etc, wasn't HTML 4.01 Traditional "Valid"

    So i changed it to:

    <body style="margin: 0px;">

    and dats Valid HTML,

    So try that

    Like:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>This is my page title</title>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
    </head>
    <body style="margin: 0px;">
    
    <iframe frameborder="0" style="width:100%; height:100%;" src="myPage.html" name="CommentsFrame"></iframe>
    
    </body>
    </html>
    Note: This is the way it shud b set out, u can add more Meta Tag's etc, but u shud really have the content-type 1 and the DOCTYPE header
    Wayne

  23. #23
    Lively Member jamieoboth's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    116
    Originally posted by The Hobo
    No need to bring religion into this.

    Would you tell a man building a house to use Elmer's Glue when he can't find nails? If you're a lunatic, maybe.

    Yes. And yes. Look at the smiling face. Theres no way it could be THAT happy without something being wrong.... Elmers glue? :|


    Try no more nails. lol....
    Ich widerstehe allem - nur nicht der Versuchung

    (I can resist anything but temptation)

  24. #24
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by jamieoboth
    Yes. And yes. Look at the smiling face. Theres no way it could be THAT happy without something being wrong.... Elmers glue? :|


    Try no more nails. lol....
    Try posting after you've sobered up. You'll make more sense that way.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  25. #25
    Member
    Join Date
    Dec 2002
    Location
    Delaware
    Posts
    34
    You could also do:

    <html>
    <head>
    <title>Title</title>
    </head>
    <body style="margin:0px;">
    <div style="height:100%;width:100%;">
    <img src="filler.ext" height="50">
    <div style="height:100%;width:100%;">
    <iframe width="100%" height="100%">
    </div>
    </div>
    </body>
    </html>

    That will probably work.
    Tolkien is the greatest writer ever.

  26. #26

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Originally posted by Zach Elfers
    You could also do:

    <html>
    <head>
    <title>Title</title>
    </head>
    <body style="margin:0px;">
    <div style="height:100%;width:100%;">
    <img src="filler.ext" height="50">
    <div style="height:100%;width:100%;">
    <iframe width="100%" height="100%">
    </div>
    </div>
    </body>
    </html>

    That will probably work.
    nope
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width