SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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.

  3. #3
    SitePoint Guru bronze trophy TheRaptor's Avatar
    Join Date
    Jul 2011
    Location
    New York
    Posts
    710
    Mentioned
    40 Post(s)
    Tagged
    0 Thread(s)
    This should do it:
    Code:
    html { font-size: 100%; overflow-y: scroll; }

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,367
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    You can add this to your css:
    Code:
    html{overflow-y:scroll}
    That will create the space for the vertical scrollbar at all times.

  5. #5
    SitePoint Guru bronze trophy TheRaptor's Avatar
    Join Date
    Jul 2011
    Location
    New York
    Posts
    710
    Mentioned
    40 Post(s)
    Tagged
    0 Thread(s)
    Already responded to your thread here: http://www.sitepoint.com/forums/html...rs-771566.html

    No use having two threads. [EDIT: Thread has been merged.]
    Last edited by TheRaptor; Jul 20, 2011 at 09:46. Reason: Thread has been merged

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,367
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    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.

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,200
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by dtp134 View Post
    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:

    Code:
    html {overflow-y:scroll}


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •