Unexpected box height

I install:

font-size: 13.44px line-height: 1.4881 

Multiplying them gives us 20.000064

But the displayed / calculated window height is 19px

Why?

http://jsbin.com/vokesukeye/2/edit?html,output

+5
source share
2 answers

As I wrote in my comment earlier: pixel values ​​are rounded, first to a font size of 13px, and then the result to 19px, due to the nature of the pixels (which are a whole pixel or pixel, with the possible exception of the retina)

+1
source

The font size for this calculation is rounded up or down.

When I increase the CSS font to 13.6px (via the Chrome Inspect function), the height of the text container increased from 19px to 20px.

enter image description here

You can try using Inspect in your browser and interactively customize these CSS options to define your CSS settings.

+4
source

Source: https://habr.com/ru/post/1259329/


All Articles