CSS positioning and the pesky scrollbar

The Firefox and Safari browsers both display the behaviour of a scrollbar “pushing” a web page 15 pixels to the left. This causes a messy look and feel on centered websites when page A has no scrollbars and page B does. The web site will shift left and right due to scrollbar displacement.

To overcome this use the following CSS code:

     /*this is to keep page from shifting to left on load in safari and firefox*/
html { min-height: 100%; margin-bottom: 1px; }
html { overflow: -moz-scrollbars-vertical !important; }
Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks

Leave a Reply

Your email address will not be published. Required fields are marked *

*