这个问题以前可能已经问过了,但我找不到一个能帮助我的问题。无论如何,我已经创建了一个带有以下脚本的文本框:
css:

.cln{
top:220px;
width:680px;
height:350px;
text-align:left;
overflow:scroll;
white-space: nowrap;
overflow:hidden;
text-overflow:ellipsis;
}

<input type="text" class="cln" placeholder="That is my pet right there:)" maxlength="2024"/>

问题是,文本框的输入从中心开始50% to 50%,不会滚动到垂直滚动,就像您键入的行水平一样。
但我希望它从左上角开始,不要越过文本框边框。
到目前为止,我所能做的就是改变,删除white-space overflow text-align等等,但没有任何帮助。
提前谢谢:)

最佳答案

使用下面这样的textarea。它将自动滚动

This will scroll automatically...<br/>
<textarea type="text" class="cln" placeholder="That is my pet right there:)" col=30 rows=10> </textarea> 

09-10 15:24
查看更多