老师讲的3-11图文样式,,貌似不对,根据代码body里面line-height:200%,效果不是跟body计算,还是根据元素本身*2
来源:3-12 图文样式-解题

李慧_0001
2020-08-08
写回答
2回答
-
body { font-size: 20px; line-height: 200%; } p { background-color: #ccc; font-size: 16px; }
此时 p 标签计算出来的 line-height 是 40px 。自己可以去运行 demo 试试。
112020-08-12 -
PAN_0109
2020-08-20
如果你子元素中也写了 line-heigh 的话,那么行高就是 (子元素的line-height * body的font-size) 了,但这就不是继承了
00
相似问题