PDA

View Full Version : Shifting Pages Due to Vertical Scroll Bars


nawset
Aug-24-2009, 03:13 PM
My banner image (www.nawset.com) shifts to the left on pages that employ a vertical scroll bar (an issue in ff, opera, and now ie8). I searched for code to resolve and found the following:

html { min-height: 100%; margin-bottom: 1px; }

This will make a scroll bar appear on pages even when one isn't necessary. Trouble is I am not sure where to place it (I tried the CSS section with a #html ... but no luck.

Any thoughts? Or better yet, a more eloquent way to eliminate my pesky shifting banner?

James H
Aug-24-2009, 07:31 PM
Hey Pete.

Try adding this to your CSS box instead.
html {overflow-y: scroll;}
It forces a vertical scroll bar. Works for me in IE8, FF, and Google Chrome.

I had another problem with Chrome and short pages. The page would display a white block beneath any unused space below the footer. I fixed that by adding this to my CSS:
html {height:100.1%;}
Hopefully someone else will chime in if they see a problem with either one of those being compatible with SmugMug's code. I picked up both ideas from this page:
http://css-tricks.com/eliminate-jumps-in-horizontal-centering-by-forcing-a-scroll-bar/