1

I have been searched how to align center verticaly and I found this answer:
How do I vertically center text with CSS?

So I try do to it in my website but its not working
The reason that that not working its because I use google font when I cancel it in the inspector that text aligned to the middle,
My text is in table cell and I gave it:

vertical-align:middle;

I also tried to achive that with line-height but same result
the text appear at the top

In jsfiddle its work with google font, example: https://jsfiddle.net/e6732sq8/
But In my web dosent, my web: http://codepen.io/anon/pen/qRVJrq (sorry for didnt upload to jsfiddle, there its work fine)

If I wasent clear I mean that gray text in the table

Community
  • 1
  • 1
Nati V
  • 682
  • 4
  • 10
  • 17

2 Answers2

0

Set this:

td{
display:flex;
align-items: center;
}
Farzin Kanzi
  • 3,380
  • 2
  • 21
  • 23
0

This problem might be caused by non-Latin characters in the font.

Try adding this to your @font-face declaration:

@font-face {
    /* latin */
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

If you're self hosting the font, you can also run the source font file (e.g. ttf) through Font Squirrel's Webfont Generator and choose Latin-only subsetting which would also have the benefit of a smaller font file.

Aaron Cicali
  • 1,496
  • 13
  • 24