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.
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<body>
<style>
.textarea {
border: 1px solid silver;
width: 300px;
min-height: 20px;
max-height: 200px; /* optional */
overflow-x: hidden;
overflow-y: auto;
}
</style>
<div class="textarea" contenteditable="true"></div>
</body>
</html>