views:

410

answers:

2

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
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
Yes, but IIRC, this shows *both* scrollbars. I don't really need the horizontal one.
Dmitri Nesteruk
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
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