Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 681
Donotello Avatar asked Aug 04 '11 10:08

Donotello


1 Answers

It's because textarea is a replaced inline element.

textarea {
    display:block;
}

should solve your "problem".

like image 80
MatTheCat Avatar answered Sep 30 '22 12:09

MatTheCat