Thanks for the article!
One small thing I don't think is quite right. You say em is relative to the current element's font-size, but I believe it is actually the parent element's font-size. Which is why it can lead to unexpected results.
In the example in MDN Docs, h1 element inherits line-height: 1.1em from its parent div element; Only in such circumstance the computed line-height of h1 would be 1.1 * its parent element's font-size;
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the article!
One small thing I don't think is quite right. You say
em
is relative to the current element's font-size, but I believe it is actually the parent element's font-size. Which is why it can lead to unexpected results.Here's a link to the example in the MDN Docs - MDN Docs Example of why to use unitless
Please have a look here: example
In the example in MDN Docs, h1 element inherits
line-height: 1.1em
from its parent div element; Only in such circumstance the computed line-height of h1 would be 1.1 * its parent element's font-size;