0d: 00h: 00m: 00s

šŸŽ Get 3 extra months of learning — completely FREE

That's 90 extra days to master new skills, build more projects, and land your dream job.

Become a PRO
Background Image

šŸŽ Get 3 extra months of learning completely FREE

Become a PRO
S
PRO
last week
Stephencountry asked

Why does line-height: 1.5; look normal, but line-height: 1.5px; makes the lines super tight? Does adding px really change the meaning?

Abhay Jajodia
Expert
yesterday
Abhay Jajodia answered

Yes, it changes the meaning a lot. line-height: 1.5; is unitless, so it means 1.5 times the font size, but line-height: 1.5px; forces the line height to be only 1.5 pixels, which is tiny and crushes the text. That’s why lessons usually use the unitless version for readable, scalable spacing.

If you have more questions, I am here to help.

CSS
This question was asked as part of the Learn CSS course.