EN
How to autogrow textarea with CSS3?
19 points
It is not possible to enable autogrowing for textarea
with CSS3 and earlier versions.
Hint: read this article how to do it with JavaScript.
As alternative contenteditable
attribute with div
element can be used.
xxxxxxxxxx
1
2
<html>
3
<body>
4
<style>
5
6
.textarea {
7
border: 1px solid silver;
8
width: 300px;
9
min-height: 20px;
10
max-height: 200px; /* optional */
11
overflow-x: hidden;
12
overflow-y: auto;
13
}
14
15
</style>
16
<div class="textarea" contenteditable="true"></div>
17
</body>
18
</html>