Question

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.

Was it helpful?

Solution

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;
}

OTHER TIPS

Here you have an example: http://html5demos.com/contenteditable look at it's source code with chrome or firebug.

It all goes around the width, height, and overflow. You should also be carefull with the word-wrap property. Check it out! :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top