1. 子元素会继承父元素已计算的行高,而不是百分比
参考:https://www.w3.org/TR/2008/REC-CSS1-20080411/
Often, the value of a property is a percentage that refers to another property:
P { font-size: 10pt } P { line-height: 120% } /* relative to ‘font-size‘, i.e. 12pt */For each property that allows percentage values, it is defined what property it refers to. Children elements of ‘P‘ will inherit the computed value of ‘line-height‘ (i.e. 12pt), not the percentage.
时间: 2024-11-08 04:14:39