Scrollbar is not showing in textarea for height:30px

元气小坏坏 提交于 2019-12-23 17:33:53

问题


I am helping my friend today. He came across an issue that he wants a textarea to display in a height of 30px with scrollbar. Unfortunately if we give a height to the textarea the scrollbar is not shown but its working when we use the mouse scroller/keyboard up and down navigation keys.

Css

<style type="text/css">
.txtarea { height:50px; overflow-y:scroll;  }
</style>

Html

<textarea class="txtarea"></textarea>

Please help.


回答1:


.txtarea {
    overflow-y: visible
}

Also, The text area has to be at least ~70px high otherwise the box is too small to show the scrollbar.

http://jsfiddle.net/gTzPM/



来源:https://stackoverflow.com/questions/4646373/scrollbar-is-not-showing-in-textarea-for-height30px

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!