Edinburgh web design and marketing articles, musings - Blot Design, Edinburgh


Latest Post | Last 10 Posts | Archives


Previous Post: Your own website cartoons!
Next Post: Find your IP address

Forcing vertical scrollbar

Posted in:

We quite often want to force a browser vertical scrollbar on a page when we have pages that are shorter than the height of the screen.

Why? because we don’t want page elements ‘jumping’ horizontally when a visitor transitions from a page without a vertical scroll to one that has (or vice-versa).

We always used to use CSS:


html {min-height:100%; margin-bottom:1px}

to force the vertical scroll, but with latest versions of Firefox and IE this has stopped working. So now we are using:


html {min-height:100.2%;}

Not particularly elegant, but it works. When CSS3 becomes gets widespread, we’ll probably change to


html {overflow-y: scroll;}

posted by info
December 14, 2009 @ 12:25 pm

Comments

  1. No comments on this post so far.

Add a comment

Sorry, comments are closed at this time.

Previous Post: Your own website cartoons!
Next Post: Find your IP address


Last 10 posts:

More Posts (Archives)

Powered by WordPress. WordPress Mobile Edition available at alexking.org.