/* always show scrollbar in FF */
html {
overflow: -moz-scrollbars-vertical;
}
/* hide necessary scrollbar for textarea in IE */
* html textarea{
overflow:auto;
}
update: there's a side effect: horizontal scrollbars will never appear
* -moz-scrollbars-horizontal: Indicates that horizontal scrollbars should always appear and vertical scrollbars should never appear.
* -moz-scrollbars-vertical: Indicates that vertical scrollbars should always appear and horizontal scrollbars should never appear.
* -moz-scrollbars-none: Indicates that no scrollbars should appear but the element should be scrollable from script. (This is the same as hidden, and has been since Mozilla 1.6alpha.)
Forcing Firefox to always show a scroll bar - TOLRA Community Forums
Adding the following to your CSS file causes Firefox to always show the scroll bar:
Code:
html { min-height: 100%; margin-bottom: 1px; }
The normal operation is for Firefox to remove the scroll bar if it's not needed which can lead to the page shifting left and right slightly between long and short pages.
update: this is one perfect solution
Always Show Vertical Scrollbar in Firefox [firefox] [css] [web]
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.
沒有留言:
張貼留言