jamesyfx
08-30-2004, 03:48 PM
Hi,
If I want an object to reach the bottom of the page on all resolutions (100% height).. how would I go about this?
In Mozilla, I *think* 100% height means it will just be as tall as the content inside it 'stretches' it.
I dont really know how to do this.. it's something thats holding me back a bit. :/
the_pm
08-30-2004, 04:08 PM
First of all, make sure you tell the browser that everything on the page should be rendered relative to 100% height, like so:
html, body { height:100% ; width:100% }
Next, I hate to say this, but you're going to need to wrap all of your page's contents into a table, and make the table take up the entire page too (it will expand if your content pushes beyond the bottom of the page),
(IN CSS) .wrapper { height:100% ; width:100% }
(IN HTML) <table class="wrapper"> etc...
Of course, you could combine all of the CSS into one rule, just to keep things concise:
html, body, .wrapper { height:100% ; width:100% }
And now, everything will stretch the height of the browser window.
RegisteringBites
08-30-2004, 04:18 PM
The only way for this to work consistently from what I've found is to have the client browser send its height back to the server (via a hidden form variable or similar) and then have the server enclose all the content in a single large TABLE set with a narrow and tall pseudo-hard-coded width/height in an invisible image graphic down one side, for example. Apologies if this doesn't make sense...
<table width="123" height="123"><tr><td width="1" rowspan="3">tall thin invisible graphic</td><td>wide thin invisible graphic</td><td width="1" rowspan="3">tall thin invisible graphic</td></tr><tr><td>The middle, usable content portion of the screen</td></tr><tr><td>wide thin invisible graphic</td></tr></table>
The width and height in the outer-most table would be divined from that knowledge gained from the information passed from the client browser. A resize() override is necessary when the user resizes their window to reset the server-stored information.
Looking ahead... actually, "the_pm" has posted what is probably an easier method that I'll need to evaluate for compatibility but I'd bet that even v4 browsers support those CSS attributes in read/write mode...