I am learning CSS. I have a div which contains a flexible textarea. Now I want the textarea and outer div to auto expand height when the user inputs multiline content in the textarea, and when the textarea is more than 3 rows, stop the expand and scroll the textarea. How should I write the CSS?
Rendered Code:
.outerdiv {
height: auto;
display: flex;
}
.outerdiv textarea {
height: 100%;
flex-grow: 1;
}
<div class="outerdiv">
<textarea></textarea>
</div>