Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force vertical scrollbar to display in IE8

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?

like image 950
Alec Smart Avatar asked Sep 07 '09 15:09

Alec Smart


People also ask

How do I make my vertical scrollbar always visible?

To show the scrollbars always on the webpage, use overflow: scroll Property. It will add both horizontal and vertical scrollbars to the webpage. To add only horizontal scrollbar use overflow-x: scroll property and for vertical scrollbar use overflow-y: scroll property.

How do I set my vertical scrollbar?

For vertical scrollable bar use the x and y axis. Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.

How do I make my scrollbar visible?

Add CSS. Set the overflow property to “auto”. This value adds scrollbar when the content overflows. Set the width and height of the <div>.


1 Answers

Oh figured it. Its

body {
   overflow-y: scroll;
}
like image 97
Alec Smart Avatar answered Oct 16 '22 14:10

Alec Smart