Chrome sizing bug or my misunderstanding?
When I view the following in Chrome 13.0.782.215 Linux, I find that the div is 5px too high. Looking in the inspector, it seems that chrome is calculating the height of the contents to be 37px (30 + 5 + 2*1 for the borders). 开发者_如何学运维 Is the 5px a bug? I don't see this problem in Firefox 3.6 or 6.0.
http://jsfiddle.net/drpXE/5/
http://jsfiddle.net/drpXE/12/
In this case it's not extra padding, it's merely the textarea position with inline text. Set it vertical-align to something like text-top, or middle and you will see the extra 5px disappear.
textarea
{
height:30px;
vertical-align: text-top;
}
It all depends on whatever else you add to the div and how you want it to look.
精彩评论