在textarea上启用垂直滚动 [英] Enable vertical scrolling on textarea

查看:488
本文介绍了在textarea上启用垂直滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个textarea,我想启用垂直滚动。当我超过textarea的高度,它的大小增加。不出现滚动条。我想要一个垂直滚动条出现,用户也不能调整文本区域的大小。

I have a textarea that I want to enable vertical scrolling. When I exceed the height of the textarea, it increases in size. The scroll bar does not appear. I want that a vertical scroll bar appears and the users are not able to resize the text area as well.

我在网上搜索并尝试了解决方案,但没有任何工作。

I searched online and tried solutions posted, but none seem to work.

演示: http://jsfiddle.net/hozefa/8fv6e/

CSS:

#imageURLId{
font-size: 14px;
font-weight: normal;
resize: none;
overflow-y: scroll;
}

HTML:

<label for="aboutDescription" id="aboutHeading">About</label>
<textarea rows="15" cols="50" id="aboutDescription"
    style="resize: none;"></textarea>
<a  id="imageURLId" target="_blank">Go to
    HomePage</a>


推荐答案

您可以尝试添加:

#aboutDescription
{
    height: 100px;
    max-height: 100px;  
}

更新:http://jsfiddle.net/8fv6e/3/

这篇关于在textarea上启用垂直滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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