denno020 Posted March 15, 2011 Share Posted March 15, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/230676-stop-content-moving-when-vertical-scroller-appears-margin-auto/ Share on other sites More sharing options...
cssfreakie Posted March 15, 2011 Share Posted March 15, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/230676-stop-content-moving-when-vertical-scroller-appears-margin-auto/#findComment-1187666 Share on other sites More sharing options...
denno020 Posted March 15, 2011 Author Share Posted March 15, 2011 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 woops. Denno Quote Link to comment https://forums.phpfreaks.com/topic/230676-stop-content-moving-when-vertical-scroller-appears-margin-auto/#findComment-1187669 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.