The quickest way I found to do this and to keep the website standards compliant is to implement JavaScript to do my resizing for me. The following code is what I use (please note that I only tested in the major web browsers):<br>
<br><script type="text/javascript"><br> window.onresize = resizeWindow;<br> function resizeWindow() {<br> var browser_height = 0;<br> try {<br> if (parseInt(document.documentElement.clientHeight) > browser_height) {<br>
browser_height = parseInt(document.documentElement.clientHeight);<br> }<br> } catch(e) { }<br> if (!browser_height || isNaN(browser_height)) { browser_height = 0; }<br> if (browser_height == 0) {<br>
try {<br> if (parseInt(document.body.clientHeight) > browser_height) {<br> browser_height = parseInt(document.body.clientHeight);<br> }<br> } catch(e) { }<br>
if (!browser_height || isNaN(browser_height)) { browser_height = 0; }<br> }<br> document.getElementById('map').style.height = browser_height+'px';<br> }<br></script><br><body onload="resizeWindow();init();"><br>
<br><div class="gmail_quote">On Wed, Jun 4, 2008 at 5:46 AM, Andreas Hocevar <<a href="mailto:andreas.hocevar@gmail.com">andreas.hocevar@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I need some advice on how to style an OpenLayers map that should have<br>
a 1-pixel border and fill 100% of the view port. This is no problem in<br>
quirks mode, but in standards compliant mode it won't work in IE. This<br>
is the CSS I have now:<br>
<br>
html, body {<br>
width: 100%;<br>
height: 100%;<br>
overflow: hidden;<br>
margin: 0px;<br>
}<br>
#map {<br>
border: 1px solid black;<br>
position: absolute;<br>
bottom: 0px;<br>
top: 0px;<br>
left: 0px;<br>
right: 0px;<br>
}<br>
<br>
In IE (6+7), I see the borders, but no map. If I add "height:100%" to<br>
#map, I see the map (with all borders in IE6+7, without bottom border<br>
in FF), but when opening a popup in IE 7, the map disappears. It works<br>
fine in quirks mode, but I need standards compliant mode for this<br>
application.<br>
<br>
Any help would be highly appreciated.<br>
<br>
Thanks<br>
Andreas.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>--<br>Nathan Gerber