滚动条未在textarea中显示高度:30像素 [英] Scrollbar is not showing in textarea for height:30px

查看:157
本文介绍了滚动条未在textarea中显示高度:30像素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天帮助我的朋友。他遇到了一个问题,他想要一个textarea显示在30px的高度与滚动条。不幸的是,如果我们给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>

请帮助。

推荐答案

.txtarea {
    overflow-y: visible
}

此外,
文本区域必须至少〜70px高,否则框会太小,不能显示滚动条。

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/

这篇关于滚动条未在textarea中显示高度:30像素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆