Forum Moderators: open

Message Too Old, No Replies

How to force scrollbar display in Firefox

         

MattHock

6:40 pm on Jun 17, 2005 (gmt 0)

10+ Year Member



A little alignment issue I'm running into for pages centered in the window: In IE, the righthand scrollbar is always visible. As a result, when browsing between pages where the length varies, the scrollbar just enables and disables. However, in Firefox, it totally goes away when it's not needed. As a result, when switching between centered pages that are long and short, the centering can shift a few pixels side to side, disrupting the presentation of the page. Is there a way to force the Firefox vertical scrollbar to always be visible, so that the alignment isn't a problem?

Sathallrin

6:58 pm on Jun 17, 2005 (gmt 0)

10+ Year Member



<style type="text/css">
html {
overflow: scroll;
}
</style>

Although this also forces a horizontal scrollbar as well, it does it on both IE and FF... So atleast they look the same.

tedster

9:23 pm on Jun 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



encyclo once shared this ugly hack with us - yes, it's ugly, but it forces only the right scrollbar.

CSS:

#scroll {
position:absolute;
top:0;
bottom:-0.1px;
width:1em;
z-index:-1;
}

And (X)HTML:

<div id="scroll"></div>