CSS - Line height property, how it works (simple)

前端 未结 8 700
梦如初夏
梦如初夏 2020-12-11 16:49

So in this simple example I have as final result:

\"alt

This is a very simple question but I sim

8条回答
  •  独厮守ぢ
    2020-12-11 17:22

    Using the line-height property to 100px means that the text is going to be vertically centered in the middle of a line with a 100px height. Meaning it will be placed around 50px. Setting the margins to 50px will give you a similar result but you might notice its not exactly centered.

提交回复
热议问题