HTML & CSS · Junior · Question 61 of 75
Why is a unitless line-height: 1.5 usually better than line-height: 24px?
- ✓Correct answer: Children inherit the factor and compute it from their own font size
- 2Unitless values render faster
- 3Pixel values are not allowed for
line-height
Explanation
With 24px (or 1.5em), children inherit the computed pixel value, so a large heading inside gets cramped lines. A unitless number scales with each element's font.