Log in

View Full Version : jumping div if taller than browser



emecks
09-13-2006, 09:50 AM
Hi, I'm new here but not a stranger to CSS anyway, I've been having an annoying problem with centered designs that have some pages taller than the browser and some that fit the height of the browser.

When I navigate from a "short" page without a vertical scrollbar to a "long" page with a vertical scrollbar the centered content jumps to the left a few pixels.

I am centering my pages with

margin:auto;

and it only happens on bigger resolutions....

Any ideas how to fix this??

emecks
09-13-2006, 10:30 AM
!!FIXED!!

just to let you know in case anyone else suffers the same:


1. add "overflow-y:scroll;" to the body tag.

2. BUT this causes double scrollbars in IE - uuuurrrrrg.

3. SO conditional stylesheet for FF where you add the overflow property and one for IE where you dont.

job solved, feet up, cuppa tea :D

ItsMeOnly
09-13-2006, 11:26 AM
how about making the center div the height of the body and it's contents scrolled?

emecks
09-14-2006, 08:06 AM
thanks ItsMeOnly,

no good for this design, but a good idea all the same :)