我期望继承时重新计算相对单位,因此在下面的示例中,子元素应该大于其父元素:
.parent {
font-size: 1.5em; /* Updated font size for the parent */
}
<div class="parent">
Parent with updated font-size 1.5em
<div class="child">
Child with inherited font-size (calculated: 1.5 * 1.5em)
</div>
</div>
为什么子类的字体大小没有按预期计算?我错过了什么?