I cannot understand why the select element has a greater height than input[type="text"] .
I thought line-height controls the height of inline elements like select and input , but it seems to be a little different than the select element.
Example: http://jsfiddle.net/Dismissile/mnBsV/
I set the following style:
input[type="text"], select { padding: 2px; border: 1px solid #ccc; margin: 0; line-height: 16px; font-size: 14px; }
I would think that the elements would behave as such:
16px + 4px + 2px (line-height + padding + border) = 22px
This is what it does for input, but it makes a choice:
18px + 4px + 2px
Where does he get 18px? Why are they not consistent? This is tested in both IE8 and Chrome 15.
source share