Sent by Chris Hays on 2 September 2002 22:10
Seeing as min-width and max-width are apparently only supported in very
few browsers (NN6+/Mozilla as far as major browsers go) what
workarounds are available for the rest of the world?
I have a client who wants a report to appear nicely onscreen and so far I've
been able to do that by defining
div.content { margin: 0px 21px }
with the tables contained at 100% width (to fill the div). However, at wider
window widths the data in the tables becomes too spaced out, harder to
read. At narrow window widths (lower rez displays) it still fits in the
window nicely (which it didn't before redesign). Min-width and max-width
would be perfect here.
My thought was Javascript called onLoad and onResize but I don't really
know JS syntax and the like, so... The basic questions are:
- how to redefine/write CSS styles on the fly (inline or otherwise)
- how to get the browser window width size with JS
The basic (not really JavaScript, as far as I know) workings I envision like
this:
function setSize() {
if windowWidth >= 500, <= 700 // px measurement
divWidth == windowWidth
else
divWidth == 700
}
Of course, any other suggested CSS-based workarounds are greatly
appreciated :)
- Chris Hays
[EMAIL-REMOVED]
no.e studios
www.noestudios.com