I discovered a strange sizing phenomenon. The <input>
element in the following snippet results in different height
with Chrome and Firefox only with font-family:Roboto
and font-size:14px
.
When I set the font-size
to 15px or use a different font, everything seems to be alright and it stays at height:35px
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" />
<style>
input {
font-family: Roboto;
font-size: 14px;
padding: 8px;
border: 1px solid black;
margin: 0;
}
</style>
</head>
<body>
<input type="text" value="this is a test" />
</body>
</html>
13" MacBook Pro (2017 - Mojave 10.14.2):
- External 25" Dell U2518D Screen:
- Firefox:
height:35px
- Chrome:
height:34px
- Safari:
height:34px
- Firefox:
15" HP Windows 10 Notebook:
- Chrome:
height:35px
- Firefox:
height:35px
- Edge:
height:34.8px
Can somebody explain the 1px difference between Chrome and Firefox on the Mac? Or the 1px difference between Chrome on Mac and Chrome on Windows?
And why does it only happen with a 14px font-size?
EDITED: Tried to clarify the question