Reserved space for vertical scrollbar in IE 4
IE reserves space for their vertical scrollbar. This, isn’t always very desirable … Of course, there’s no problem if you actually need the scrollbar, but when you don’t …
When you use a bgcolor1 in the body and place a div tag in it over the full width of your page with another bgcolor2, you’ll see that in the space reserved for the vertical scrollbar bgcolor1 will appear and not the desired bgcolor2.
This is b/c IE reserves that space for the scrollbar, whether you need it or not … FF on the other hand never reserves the space … the downside of this could be that when the scrollbar is needed you’ll see your page content move. But … in this example, it still is the lesser of the 2 evils
…
So, the workaround for IE, so that it doesn’t reserve that space, is:
body {
overflow: auto;
}
HTML {
overflow: auto;
}
you need both!!








Feb 28, 2007 @ 04:16:42
Thanks. This work fine to me!!!
Mar 03, 2007 @ 18:11:22
It took me a while before I realized I needed both of them, thought I could post it to make life easier for the next person who came across this problem … so I’m glad it helped you
Jun 07, 2007 @ 00:10:44
Thank you. Can’t believe the pain I went through when there was this simple fix all along!
Jun 07, 2007 @ 11:01:36
Seek and you shall find
… glad it helped you!