Here is a screenshot of the sample design I made:

Between the bottom of the letters and the red line is a 10px space. I am trying to reproduce this with the following code:
font: normal 40px arial; border-bottom: 3px solid red; padding-bottom: 10px;
Technically, this code should give me exactly what I want. But this is not so. Here is a screenshot of this in action in Chrome:

Due to the height of the line between the text and the border, there is additional space. Here's a screenshot taken in Chrome:

When I take my time and measure the space under the letters caused by the height of the line, I see this 9px empty area. So, to get 10px of space between the text and the border, I need to change my code to:
padding-bottom: 1px;
The solution to this could be to add the line-height property with the amount of exact text height in the design file. But then it will ruin if the text contains several lines.
What is the best approach to achieve perfect pixel design conversion?
source share