Samuel Page Digital Playground & Blog

1Jan/101
forcing-vertical-scroll-bars-in-firefox

Forcing vertical scroll bars in Firefox

Posted by Samuel Page

By default Firefox doesn't have the vertical scroll bar visible unless the page requires it.

On site where some pages need the scroll bar, but others don't this can make centered content appear to jump slightly to the left / right as the scroll bar is introduced and taken away.

Here's a nice CSS trick to force Firefox (and other browsers) to always show the scroll bar, even if it isn't required:

html {overflow-y:scroll;}

It's worth noting that this will prevent your CSS from validating - W3C returns the following message:

Property overflow-y doesn't exist in CSS level 2.1 but exists in : scroll scroll

Credit goes to http://freizl.blogspot.com/2008/01/force-vertical-scroll-bar-in-firefox.html

About Samuel Page

Sam Page, co-founder and director at 7dots Digital Consultancy.
Comments (1) Trackbacks (0)
  1. Just want to say what a great blog you got here!
    I’ve been around for quite a lot of time, but finally decided to show my appreciation of your work!

    Thumbs up, and keep it going!

    Cheers
    Christian


Leave a comment


No trackbacks yet.