C
C
Cyril2018-04-13 19:47:37
css
Cyril, 2018-04-13 19:47:37

How to make line-height cross browser?

There is no way to make the line-height property the same in Google Chrome and Mozilla.
In Google Chrome, the text is set exactly in the middle:
5ad0ddd231881654025570.png
And in Mozilla, for some reason, with a shift down:
5ad0ddfd2f789945437719.png
The property itself looks like this:

.contacts {
    height: 69px
    font: normal 14px/5.0714285 'Open Sans', sans-serif
}

I tried to use em instead of pixels , given that the font-size of the body is 13px:
body {
    font-size: 13px
    line-height: normal
}
.contacts {
    height: 69px
    font: normal 1.077em/5.0714285 'Open Sans', sans-serif
}

But it still doesn't work.
Can you please tell me how to make the menu text in the middle without offsets in all browsers? Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Cyril, 2018-04-13
@cyril_b

Try Flex!

N
NaN, 2018-05-31
@KornevaViktoria

https://habr.com/company/netcracker/blog/277433/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question