DEV Community

Discussion on: How CSS line-height works and best practices

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Your are right!
It should be 150%!

Yeah while I was writing this I was thinking for some reason about witdh or height. % in line-heigh refers to the font-size of the element.

Thank you!

Collapse
 
bitdweller profile image
Pedro Pimenta

Yes and it refers to the font-size of the element itself. I think that for .child to have a line-height of 24px it should have it set to 100%.

Thread Thread
 
lampewebdev profile image
Michael "lampe" Lazarski

I just forgot to update the CSS 🤣.

Now it should be correct!

Thanks again! appreciated it!