height vs line-height styling

后端 未结 6 1538
北恋
北恋 2020-12-13 13:14

What is the difference between using these two when dealing with text that will never be more than a single line? They both can produce similar results on the screen from w

6条回答
  •  长情又很酷
    2020-12-13 13:59

    For practical purposes in the case you cite (never wrapping to more than one line) line-height will vertically center the text. Be careful about that assumption though as the user ultimately controls the font-size.

提交回复
热议问题