Jump to content

Stop content moving when vertical scroller appears - margin: auto


denno020

Recommended Posts

I have auto margins for left and right for my wrapper to centre it in the page. When the page is longer than the browser window, obviously the vertical scroll will appear. However, when that happens, the wrapper will shift to the left so that it is still in the centre. Is there any way of avoiding this?

 

Thanks

Luke

do you mean shift to the left the 18 pixels the scrollbar is width? If that is the case maybe use javascript to check the length of the page according to the screen height, and if the one is larger than expected set margin-right to -18pixels.

Not sure though, but that was just that popped up here :)

 

Why would you want do that, to prevent the little shift?

 

or maybe put the wrapper on overflow hidden and put a container in that with overflow:scroll; But i am now just brain farting :D

 

yeah it's stop stop the little shift. It's irritating me...

More javascript aye lol. I shall look into that too :).

 

Thanks for your help dude. And even when I post this in the wrong sub-forum :o woops.

 

Denno

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.