Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix inconsistent Textarea bottom margin in Firefox and Chrome?

I'm trying to eliminate the extra bottom margin that both FF and Chrome seem to give to Textareas. Surprisingly IE seems to do it correctly. I would like to avoid using conditional includes but CSS3 tweaks are OK.

Sample Code

.red-box {      background-color: red;      overflow: hidden;  }  textarea {      border: solid 1px #ddd;      margin: 0px; /* Has no effect */  }
<div class="red-box">      <textarea>No Margin Please!</textarea>  </div>
like image 230
Tim Santeford Avatar asked Aug 10 '10 22:08

Tim Santeford


2 Answers

By default, I believe both Chrome and Firefox will set these elements as display: inline-block;. Set display: block in your styles and you should be all set.

like image 143
kmfk Avatar answered Oct 05 '22 16:10

kmfk


If you want to leave it inline, simply try

vertical-align: top 
like image 26
David Vielhuber Avatar answered Oct 05 '22 16:10

David Vielhuber