Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iframe height=100%

Status
Not open for further replies.

blitzer

Programmer
Jun 18, 2001
34
0
0
CA
Hey all. I am making a layout which uses tower banners on the right side of the page. i have the towers on a page which stacks them height-wise. this page is called with an iframe which stretches to the height of the current page (which will vary). here is a simplified page which shows what i am doing:


it works fine for me as i use explorer, but some people have had problems, such as it doesnt work with netscape. also with firefox it sometimes only stretches about 100 pixels rather than 100% of the page.

just wondering if anyone has any experience trying something like this and/or if you can forsee any more problems with programming like this. I cant test every type of browser out there! Thanks for reading!

Blitz
 

I cant test every type of browser out there!

No - but you can test quite a few of most common ones (IE, NN, FF, and Opera - if you are running Windows, or Safari, FF, IE - if running Mac OS X).

They're all free to download, and all co-exist with each other, so if you're doing any sort of cross-browser web development, download and install them today.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Incidentally, here are a few suggestions for improvement (sorry they don't answer your original question):

1. Use complete and valid DOCTYPE.

2. Remove the "center" tags. They are no longer part of the specifications.

3. Replace all the non-standard attributes in your body element with CSS.

4. Replace all of your font elements with CSS. Font elements are also no longer part of the specifications.

5. While valid, I'd replace your "i" elements with either "em" elements (if your aim was to emphasise the text), or CSS (if your aim was just to have italicised text).

6. Standardise the case of your coding (this would need to be done if you chose a strict XHTML DOCTYPE anyway). At the moment, you mix upper and lower case freely (sometimes in the same tag name - "tD", for example).

Hope this helps,
Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
thanks for looking over my page, but i doubt those changes are necessary. the output doesnt change.

does anyone have any experience with iframe height=100% ?Thanks
 
What Dan suggested were steps to make your website more standards compliant and as such get the result that looks more uniform across different browsers and OSes. However to answer your question: height="100%" requires parent element to have a specified height. Say you put that in an element that is 100px high. Then Iframe will be 100px high. If you do not put it in an element that has height specifically set, standards say that height will be reverted to auto, meaning covering only enough to accomodate the text inside. Since iframe loads another page inside, it cannot assess how much that space is and height reverts to a default size -- whatever that is for the browser.
 
but i doubt those changes are necessary. the output doesnt change.

Which is why I said:

here are a few suggestions for improvement (sorry they don't answer your original question)

As I said - they won't answer your question, but they will improve your site. Of course, it is up to you whether you heed the advice and aim for a nice standards-compliant site, or whether you ignore it, and live with a jumble of non-standard, out-dated code.

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Hi,

Try using quotes around the elements. some browsers are picky.

height="100%"

Small change but worth a try.

~Dragonfly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top