0

I have received a font (Calibre) as an OTF file from a client to use in a web app but there's something weird with the "line height" (or what do you call this?) of the file. The actual text overflows the dom element on top and leaves a bunch of space below causing all sorts of ugliness. Is there any way of compensating for this in CSS?

enter image description here

oskare
  • 970
  • 12
  • 20
  • Possible duplicate of [How do I vertically align text in a div?](https://stackoverflow.com/questions/2939914/how-do-i-vertically-align-text-in-a-div) – Michelangelo Aug 02 '19 at 13:26

1 Answers1

-2

It depends on the font. However, for most fonts, setting

div {
    height: /* your height */
    line-height: /* the same height */
}

will make it work. However, some fonts, like Aldrich, are positioned just a little higher than it feels they should be, so you have to increase the line-height by 0.4% or so.

Michael Bianconi
  • 4,757
  • 1
  • 6
  • 20