necolas / normalize.css

A modern alternative to CSS resets
http://necolas.github.io/normalize.css/
MIT License
52.28k stars 10.67k forks source link

Line height on inputs #910

Open ameenross opened 6 months ago

ameenross commented 6 months ago

I just noticed that Firefox dev tools shows a computed line-height of 20px on an input element. It attributes this to line-height: 1.15 from normalize.css. However, the font-size is computed to be 16px. The same thing in Chrome shows a line-height of 18.4px, which is what you get when you multiply 16 by 1.15. After fiddling around it appears that both browsers have a minimum for the input's line-height. In Chrome it's about 1.1-1.15. In Firefox if I set line-height to 0.1, the computed tab still says 20px, so the minimum is 1.25.

I don't know about other browsers, but I suppose then it's a good idea to set line-height for inputs to 1.25.