Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DIV Contenteditable expand problem

I have a div with contenteditable set to true to act as a text input. Now usually, it expands as some text reaches the end of the div, but if I resize the div, this stops happening. The browser no more does this. I tried to set the height after resizing it to auto, but it didn't help either.

Please help me on that one. Thanks.

like image 860
Michael S. Avatar asked Dec 08 '22 02:12

Michael S.


1 Answers

If you've set the height absolute the browser will handle it absolute. So apply the following css rules to your div:

#yourdiv {
    height: auto;
    min-height: 150px;
}
like image 155
noob Avatar answered Dec 24 '22 04:12

noob