HTML / CSS fix for vertical scroll bar

Soldato
Joined
28 Sep 2008
Posts
14,207
Location
Britain
Is there a "fix" these days, other than adding a scroll bar to every page?

The pages on my site which don't have a lot of vertical content are fine, but when vertical content exceeds page height, BANG! = vertical scroll bar shifts the page left.

:(

This is IE btw
 
As far as I'm aware, you have to force a scroll bar on all pages, irrespective of page height. I've not seen any alternatives.

However - interested to see if there is an alternative, of course!
 
I don't see the problem with it doing that. The page dimensions have changed.

However, I've "got around this" before by setting the main container with:
Code:
.container {
  height: 100%;
  overflow: auto;
}
so the scrollbar appears on the container div and not the page.
 
Code:
html {
overflow-y: scroll;
}

I think that the code above is an good way of forcing a scrollbar in browsers works in all browsers although i don't think it validates.
 
Last edited:
Back
Top Bottom