I have a website with center-aligned DIV. Now, some pages need scrolling, some don't. When move from one type to another, the appearance of a scrollbar moves the page a few pixels to the side. Is there any way to avoid this without explicitly showing the scrollbars on each page?
+4
A:
I think not. But styling body
with overflow: scroll
should do. You seem to know that, though.
Michael Krelin - hacker
2009-09-13 15:08:57
Sounds good... force the page to always show the scrollbar whether it needs it or not, ... then there is no visual change between page types.
eidylon
2009-09-13 16:10:23
Yes, but IIRC, this shows *both* scrollbars. I don't really need the horizontal one.
Dmitri Nesteruk
2009-09-14 10:47:32
That's true. But there's not much I can do to help you :( Actually, I only consider the first sentence of my reply to be the *real* answer that deals with the question.
Michael Krelin - hacker
2009-09-14 10:59:53
A:
I don't know if this is an old post, but i had the same problem and if you want to scroll vertically only you should try overflow-y:scroll
Isaac
2009-10-07 15:26:53