Is it possible to allow only a horizontal scroll bar when using overflow:auto (or scroll)?
Add the following:
body{
overflow-y:hidden;
}
How about a shorthand notation?
{overflow: auto hidden;}
This rules are compatible whit all browser:
body {overflow: hidden; }
body::-webkit-scrollbar { width: 0 !important; }
body { overflow: -moz-scrollbars-none; }
body { -ms-overflow-style: none; }
overflow: auto;
overflow-y: hidden;
For IE8: -ms-overflow-y: hidden;
Or Else :
To hide X:
<div style="height:150x; width:450px; overflow-x:hidden; overflow-y: scroll; padding-bottom:10px;"></div>
To hide Y:
<div style="height:150px; width:450px; overflow-x:scroll ; overflow-y: hidden; padding-bottom:10px;"></div>
if you want to disable the scrollbar, but still able to scroll the content of inner DIV, use below code in css,
.divHideScroll::-webkit-scrollbar {
width: 0 !important
}
.divHideScroll {
overflow: -moz-scrollbars-none;
}
.divHideScroll {
-ms-overflow-style: none;
}
divHideScroll is the class name of the target div.
It will work in all major browser (Chrome, Safari, Mozilla, Opera, and IE)
If you want to accomplish the same in Gecko (NS6+, Mozilla, etc) and IE4+ simultaneously, I believe this should do the trick:V
body {
overflow: -moz-scrollbars-vertical;
overflow-x: hidden;
overflow-y: auto;
}
This will be applied to entire body tag, please update it to your relevant css and apply this properties.