I'm attempting to normalize an input
field to display as a div
, giving the elements the same height in both Firefox and WebKit. When I noticed that WebKit will render a 16px/16px
text 18px
high, while Firefox will correctly render it 16px
.
What is causing this height difference and how do I remove it?
console.log(document.querySelector("div").offsetHeight)
console.log(document.querySelector("input").offsetHeight)
div,
input {
font: 16px/16px Arial;
}
input {
padding: 0;
border: 0;
}
<div>Lorem Ipsum</div>
<input type="text" value="Lorem Ipsum" />