IE6, xhtml, scrollbars and you

Giganews Newsgroups
Subject: IE6, xhtml, scrollbars and you
Posted by:  Nobody (no…@nope.net)
Date: Thu, 04 Sep 2003

Okay, you are all so smart in here.  Answer me this:

IE6 in standards mode doesn't seem to hide scrollbars on the body element
(overflow:hide)  Ain't this a quandary.  I have it in my head that I need to
specify html instead.  The scrollbars do hide on Gecko browsers though, so
there is definitely a disagreement among browser developers on how to
implement scrollbars (as a side note, Gecko browsers with their notoriously
bug-ridden resize code seem to always screw up when asked to stretch and
scroll divs, even when the page is reloaded on every resize!)

My first thought is to modify the CGI that generates the style sheet as I
already have code that deprecates the document type when hidden scroll bars
are required on IE6 (but not IE5.)  This is based on the simple empirical
evidence that the scroll bars are still there on IE6 in standards mode, so
the optimal document type (XHTML strict) cannot be used.  So I could just
change this to output an html style (rather than a body style) for IE6 and
lose the deprecation (it wouldn't be needed at this point.)

So the question is this.  Given that CGI-based processing of browser
versions for these kinds of tweaks is taboo, what would you check on the
client side before dynamically generating the style for the body and/or html
element?  It doesn't seem like you could just send both as this would surely
break some older browsers (I know you can do tricks with comments and such,
but that only works for NS4 and maybe IE3 AFAIK.)

documentElement is the only thing I can think of that indicates standards
mode and NS6/Mozilla support this AFAIK.

IE Conditional comments perhaps?  I would hate to hard-code a test for a
browser version number into the actual document (for obvious reasons), but I
guess it is an alternative if the browser version is exposed to these
things.

I don't see any other way to deal with a situation like this than with
server-side code that looks at the browser's version number and makes the
necessary adjustment.  And there are lots of little differences like this
that just don't seem to have viable client-only solutions.  There's DirectX
stuff (probably is an object detect for that) and funky colored scrollbars
(hey people ask for them) and document margins (Opera did them slightly
differently than the rest as I recall) and now this scrollbar thing.

Oh well.  If there is a definitive client-only answer to all of this then I
would love to hear it!  Otherwise, any thoughts on the #$@% scrollbars is
appreciated.

All the best,
Michael Jibbering

Replies