I have an HTML textarea that is of fixed width, but variable height. I would like to set overflow:scroll
and be able to show a vertical scrollbar, but not a horizontal one. I am not able to use overflow:auto
due to other things specific to my situation.
I know there is no way using CSS2 to show only vertical but not horizontal scrollbars. Is there anything I can do with JavaScript to hide the horizontal scrollbar?
sets 200px scrolldown size,
overflow-x
hides any horizontal scrollbar.Using
wrap=virtual
in your HTML form boxes gets rid of the horizontal scrollbar at the bottom of the box:See example here : http://jsbin.com/opube3/2 (Tested on FF and IE)
Working example with snippet and jsfiddle link https://jsfiddle.net/sx8u82xp/3/
Use CSS. It's easier and faster than javascript.
You can use css like this: