Hiding vertical scroll bars

not sure if this is an html issue, or a css thing, but here we go. I am designing a page for my massage practice. My home page has nothing but our logo and nav buttons so there is no vertical scroll bar. all the other pages have content below the navigation so there is a scroll bar. I know it’s not a huge deal, but as bars appear, every thing is shifted slightly so all my content is still centered in view port. Is there any thing that I can do so the scroll bar is always there so this doesn’t happen? or is it simply a setting on my browser that does this? Thanks.

This should do it:

html { font-size: 100%; overflow-y: scroll; }

not sure if this is an html issue, or a css thing, but here we go. I am designing a page for my massage practice. My home page has nothing but our logo and nav buttons so there is no vertical scroll bar. all the other pages have content below the navigation so there is a scroll bar. I know it’s not a huge deal, but as bars appear, every thing is shifted slightly so all my content is still centered in view port. Is there any thing that I can do so the scroll bar is always there so this doesn’t happen? or is it simply a setting on my browser that does this? Thanks.

Hi,

You can add this to your css:


html{overflow-y:scroll}


That will create the space for the vertical scrollbar at all times.

Already responded to your thread here: http://www.sitepoint.com/forums/html-xhtml-52/hiding-vertical-scroll-bars-771566.html

No use having two threads. [EDIT: Thread has been merged.]

Threads merged.

Please do not post the same question in different forums but ask an advisor to move it instead if you feel the wrong forum was chosen.

Thanks guys. Sorry about double post. Didn’t know you could move it for me if in wrong forum. Do I need a # in front of html, or just the line of code?

No, no need for #. Just place this line in your CSS file as is:

html {overflow-y:scroll}