Having an input class as shown below:
<input type="number" class="inv_1"/>
I attempted to adjust the height using CSS:
.inv_1 {
width: 50%;
height: 32px;
}
Expected result: input tag with a height of 32px. Actual result: input tag with a height of 38px.
Reducing it to 26px brought it to the desired 32px height. The issue is, can I set the actual height accurately? I want the element to match the specified height in CSS, just like divs and buttons with the same class have a consistent 32px height.
If only CSS had "actual" properties. For instance: "actualheight: 32px" would render precisely that. The same principle could apply to width, text alignment, borders, padding, etc. Just imagine how convenient it would be to achieve your intended design without a struggle.
(Update: Appreciate the responses, resolved with box-sizing: border-box. Unfortunately, only one answer can be marked as accepted)