Birowsky Birowsky - 27 days ago 13
CSS Question

Unexpected resulting box height

I'm setting:

font-size: 13.44px
line-height: 1.4881


Multiplying those, gives us 20.000064

But the rendered/calculated height of the box is 19px

Why?

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

Answer

The font-size seems to be rounded up or down for this calculation.

When I increase your CSS font-size to 13.6px (via Chrome's "Inspect" function), the text container height was increased from 19px to 20px.

enter image description here

You may want to try to use "Inspect" with your browser and interactively adjust these CSS settings to get your desired results.

Comments