滚动条未显示在高度:30px 的文本区域中
我今天正在帮助我的朋友。他遇到了一个问题,他想要一个带有滚动条的文本区域以 30px 的高度显示。不幸的是,如果我们给文本区域指定高度,则滚动条不会显示,但当我们使用鼠标滚动条/键盘上下导航键时它会起作用。
CSS
<style type="text/css">
.txtarea { height:50px; overflow-y:scroll; }
</style>
Html
<textarea class="txtarea"></textarea>
请帮忙。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
还,
文本区域的高度必须至少约为 70 像素,否则框太小而无法显示滚动条。
http://jsfiddle.net/gTzPM/
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/