Line-height without units

前端 未结 5 1509
感情败类
感情败类 2020-12-09 10:30

I saw people using line height without specifying a unit, like this: line-height: 1.5;

What does the number represents? I\'m guessing it\'s a ratio so i

5条回答
  •  心在旅途
    2020-12-09 11:11

    See the respective spec @W3C:

    The used value of the property is this number multiplied by the element's font size. Negative values are illegal. The computed value is the same as the specified value.

    So as you guessed it is a ratio and relates to the current font-size.

提交回复
热议问题