views:

3013

answers:

6

The vertical bar does not appear in IE8 if the page is not long enough. In FF, there is a workaround for this

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

I tried the following for IE8: overflow:scroll; but the scroll bar appears on both sides. I want it only for vertical and not horizontal. scroll-y does not work.

Any solution?

+5  A: 

Oh figured it. Its

body {
   overflow-y: scroll;
}
Alec Smart
Do this work for all browsers?
Kimble
+2  A: 

Another solution is to set the body height to 100% - see a before/after example at http://www.iecustomizer.com/msmvp/HTMLHeightTest.htm

Waggers
A: 

waggers solution works, but then u have to include the mozilla specific fix as well.

larry
+2  A: 

I use the following:

html { height: 101%; /* setting height to 101% forces scroll bar to display */ }

chip
+1  A: 

-ms-overflow-y : scroll;

Dave
A: 

put it in your div i.e. style="overflow: -moz-scrollbars-vertical; overflow-y: scroll;

for example :

Shubham