The difference of the line-height:2 and line-height:2em

The difference of the line-height:2 and line-height:2em

When I make up the www.apple.com/apple-pay/offers/, I need to make a box for "优惠名额已满,感谢再次惠顾", and i need to set up the line-height for the font

So what's the difference about the two css

  • Line-height:2 is based on the font what is the only themself
  • Line-height:2em is based on the font father element

we can see the difference from the code
`

The difference about the two line-height

普通文字普通文字普通文字普通文字普通文字普通文字普通文字普通文字普通文字普通文字优惠结束普通文字普通文字普通文字普通文字普通文字普通文字

普通文字普通文字普通文字普通文字普通文字普通文字普通文字普通文字普通文字普通文字优惠结束普通文字普通文字普通文字普通文字普通文字普通文字

` ![](http://images2015.cnblogs.com/blog/1183538/201707/1183538-20170720155112146-584052413.png)
Damao Zhang Apple HTML Developer RM 2330, ShangDu SOHO, South Tower, N.8 DongDaQiao Road ChaoYang District Beijing 100020 O: +86 10 5869 3315 M: +86 186 3351 1769 www.mullenloweprofero.com
原文地址:https://www.cnblogs.com/damaochina/p/7211604.html