Donotello Donotello - 1 month ago 19
CSS Question

Textarea height Chrome problem

Is anyone have solution for textarea height problem in Chrome?

In simple case like this:

<div>
<textarea>
</textarea>
</div>


Google Chrome add two pixels, so div.height = textarea.height + 2px. And yes, I try Eric's "reset.ccs" — didn't work.

P.S. of course in my "simple case" textarea and div have border, padding and margin 0px.

Answer

It's because textarea is a replaced inline element.

textarea {
    display:block;
}

should solve your "problem".