What could be causing this unusual behavior when setting line-height
to match font-size
:
While the height of label
is 16px, the height of input
is 18px... Why is that?
If I adjust line-height: 18px
or higher, the heights suddenly align. But why does this happen?
Check out the JSFiddle Example here.
<style>
label, input {
font-size: 16px;
line-height: 16px;
padding: 0;
margin: 0;
float: left;
border: none;
font-family: Arial, Helvetica, sans-serif;
}
label {
position: absolute;
}
</style>
<form>
<label for="email">Enter your email</label>
<input type="email" name="email" />
</form>
Chrome version 36 screenshots clearly display the 16/18px height contrast and absence of border
, margin
, or padding
: