When setting the text-decoration:underline
on an element, the line is shown on the baseline.
It is over the descender of letters. It makes reading difficult if the line contains many letters with descenders.
I want to move the underline below the descenders using text-underline-offset: 4px;
.
It works.
On Chrome, it is exactly how I want. However, it is not below the descenders on Safari.
If I use, text-underline-offset: 5px;
, It works on Safari. But on Chrome, It is close to the ascenders of the second line rather than being close to the descenders of the same line. I can solve it using a higher value line-height
, but that I don't want.
Is there any way to caclualte the height of the descenders so that I offset the underline exaclty that much below the baseline?
Info:
The font I am using is called Basis Grotesque Pro regular