M
M
Muvka2018-03-10 18:24:58
css
Muvka, 2018-03-10 18:24:58

Why does line-height work differently in different browsers?

Hello. Today I noticed an unpleasant feature of different browsers, probably. The problem is that in all desktop browsers, in order to make text centered in height, you need to set line-height: 35px in a container with a height of, say, 40px. But today I went to the site from a smartphone, from the same chrome, so there the text is more pressed to the top of the element. I do not understand something, and how to get around this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-03-10
@Muvka

don't use px unless absolutely necessary
learn how to align text with css

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question