Forum Moderators: open

Message Too Old, No Replies

setting the iframe height so

that it varies depending on the browser

         

lucesei

4:14 pm on Mar 9, 2004 (gmt 0)

10+ Year Member



I don't know if it's the same with you, but it seems like a pixel for i.e. does not have the same size as a pixel for netscape. Moreover, a pixel in NS is smaller than a pixel in I.E.
This makes it so that when I put an iframe on my page to import say a FORM, and I give it a fixed height, I either have to choose:
- make it look perfect in netscape and cut some of the bottom in i.e.;
- make it look perfect in i.e. and have some of the iframe's source background show at the bottom ( for example, if my page is white and the background of the imported page is blue, I will see the form, plus some blue background under it.).
Don't suggest using things like variable height: I have specific reasons why I must use a fixed height.

My question is: is there some way (javascript perhaps?) so that when the iframe is rendered I can instruct to use a certain height if it's i.e., and a different height when it's netscape.
Something like:
iframe onload:
IF
i.e.=height 100px;
IF
ns=height 92px
----sorry, I'm a disaster with javascript!-----

Thanks for all the help you can give me

grahamstewart

4:20 pm on Mar 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried using a full doctype on your page?

The difference could be caused by the different browsers using different 'quirks' box models. if you use a full doctype it will place them into 'Standards compliant' mode and you have a better chance of getting them all to look the same.

W3C Valid Doctype list [w3.org]