DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Always Show Vertical Scrollbar In Firefox

04.22.2005
| 215768 views |
  • submit to reddit
        To always show the vertical scrollbar, regardless of whether there is content to scroll (à la Internet Explorer), add this to userContent.css

html {
     overflow: -moz-scrollbars-vertical;
}

Tested in Firefox 1.0 and above.    

Comments

Snippets Manager replied on Sat, 2009/01/24 - 3:20pm

html { margin-bottom: 1px; } This works without throwing off your relative heights and it's only 1px, so nobody will ever notice.

Snippets Manager replied on Wed, 2008/12/10 - 5:37am

Here is the solution to get the vertical scrollbar for Firefox without the problem of hiding the horizontal one: html { overflow: -moz-scrollbars-vertical; } html { overflow-x: auto; }

Snippets Manager replied on Tue, 2008/04/08 - 10:27am

In a frameset environment add the attribures scrolling="yes" style="overflow-x:auto" to your Tag, and scrollbars in Firefox work like scrollbars in Internet Explorer.

Snippets Manager replied on Fri, 2007/07/27 - 2:49pm

html {overflow: scroll;} works but it also gives you a horizontal scroll bar. html {overflow-y: scroll;} will give you just a vertical scroll bar, if that's what you are going for.

Snippets Manager replied on Fri, 2007/01/12 - 8:40pm

html {overflow: scroll;} will take care of this correctly

Snippets Manager replied on Wed, 2006/12/06 - 5:18pm

html { height: 101%; } this will trick firefox into thinking there is more vertical space at the bottom of the page. It's a tiny amount, so it's not that noticible, but it helps keep pages from shifting horzontally. Hope this helps. Phil

Paul Singleton replied on Thu, 2006/02/09 - 2:14pm

Unfortunately this prevents the horizontal scrollbar from appearing when the displayed page is too wide, so that the only way to see the right edge of a wide page is to stretch the browser itself. It seems to be impossible to configure Firefox with IE's default behaviour (vertical scrollbar always present, horizontal scrollbar shown only when required).