When implementing the following CSS:
input[type=button] {
background-color: white;
border: 1px solid black;
font-size: 15px;
height: 20px;
padding: 7px;
}
along with this HTML:
<input type="button" value="Foo" />
I anticipate that the total height will be 36px
:
1px border
7px padding
20px content (with 15px text)
7px padding
1px border
However, in both Firefox 3.6 and Safari 4, I observe the following display: (Testing not done on other browsers)
Screenshot http://labs.spiqr.nl/upload/files/1223ef9cbae3ab6e43bd1f9215ebedb157ac7b22.png
1px border
7px padding
4px content (with 15px text) => height - 2 * border - 2 * padding
7px padding
1px border
Can anyone explain why this discrepancy occurs?
(Even if it's intentional behavior, what is the reasoning behind it?)