你是想要不显示滚动条,随内容往下拉伸?
单纯的textarea不能做到 , 你可以用div模拟一样个类似的 textarea效果:
html: <div class="test" contenteditable="true">
</div>
css :
.test {
width: 400px;
min-height: 20px;
max-height: 1000px;//超过1000px出现滚动条
margin: auto;
padding: 13px;
outline: 0;
border: 1px solid #a0b3d6
font-size: 16px;
line-height: 24px;
word-wrap: break-word;
overflow-x: hidden;
overflow-y: auto;
}