s1eepercat
10/10/2019 - 11:20 AM

Font units / Inheritence

2 EM for font size = x * 2 PARENTS font size 
2 REM for font size = x * 2 ROOT font size

!if EM is used to specify length, than width: 2em = current elements font size * 2!




INHERITENCE:

.parent {
  font-size: 20px;
  line-height: 150%;
}

.child {
  font-size: 30px;
}

here, child's line-height will be 20px*150% = 30px; 
IT INHERITS COMPUTED VALUE OF 30PX, NOT 150%