将滚动条添加到< textarea> [英] Add a scrollbar to a <textarea>
本文介绍了将滚动条添加到< textarea>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为textarea添加一个滚动条,以便它总是出现,即使没有什么可以向下滚动到。如果没有什么可以向下滚动到,我宁愿如果它可以变灰,表明没有什么下面。
I would like to add a scrollbar to a textarea, so that it always appears, even when there is nothing to scroll down to. If there is nothing for it to scroll down to, I would prefer if it could be greyed out, indicating that there is nothing below.
我该怎么办? / p>
How would I do this?
推荐答案
您需要的是 overflow-y:scroll;
textarea {
overflow-y: scroll;
height: 100px;
resize: none; /* Remove this if you want the user to resize the textarea */
}
这篇关于将滚动条添加到< textarea>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文