Forum Moderators: not2easy

Message Too Old, No Replies

scrollbar pushes content over

         

tonynoriega

9:47 pm on Dec 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



in my css layout im nothicing that when content exceeds teh viewing window height, it puts in the scroll bar...

fine no problems there...

but when i navigate to another page that does not, you get that content shif effect...becuase the width of the scrollbar is no longer there.

can i eliminate this?

chasehx

11:05 pm on Dec 17, 2009 (gmt 0)

10+ Year Member



In the main browser window, if the content is longer than the browser windows there is going to be a scrollbar. Now, you can use CSS to style it the same color as your background, so it does not appear to be there, however the offset will still be real. What I would do then is compensate a few pixels to the right so that the invisible scroll bar looks like part of the page.

limbo

9:16 am on Dec 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or you can force the scroll bar on all pages by absolute positioning a container element. You could also use the container as a preloader ;)

alt131

5:39 am on Dec 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm guessing this is in FF (and maybe safari) rather than ie - and if so, it is a known issue caused by the different ways of measuring the height of the viewport and the html and body elements.

One method is to give the html and body a height of 100%, then add a margin-bottom or border-bottom to either. As little as 1px should do the trick.