Forum Moderators: not2easy
I know this can be done via CSS
Can't be done with CSS, but it can be done. Set the scroll attribute in the body element to "auto" and IE displays the scrollbar only when necessary.
Scroll, however, is an IE proprietary attribute [msdn.microsoft.com] and will throw an error in the validator. One way around this is to use JS to detect IE and add it on the fly (document.body.scroll='auto'). There is not, however, any pure CSS way to control this attribute.
cEM
Can't be done with CSS,
<body style="overflow:auto">
...in quirks mode. ;)
But, of course, the disadvantage of not using a DOCTYPE
is not overweighed by having no scrollbar in IE, is it. :)
birdbrain
MSIE is a legacy browser and therefor I do not care if it is running in standards or quirks mode just so long as it works. I'm sure many people feel the same about Netscape 4?
I set the overflow to auto as a proper XHTML document should first declare XML since XHTML is a subset of XML.
The only other way to do this which would not balance a centered effect anyway would be to use IE conditional comments to set the scrollbar colors to all be the same as the body bg color but I did not want the scrollbar rendering whatsoever.
Thanks to both of you!