I think there's a mistake with the percentage definition. When you define line-height to 1.5% you don't multiply it by 1.5, you multiply it by 0.15.
line-height
1.5%
1.5
0.15
Also it refers to the element it is defined, not the parent. 100% on the child would give a line-height value of 24px.
100%
24px
At least it's what I'm getting on Firefox. Is it different for you?
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!
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%.
font-size
.child
I just forgot to update the CSS 🤣.
Now it should be correct!
Thanks again! appreciated it!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
I think there's a mistake with the percentage definition. When you define
line-height
to1.5%
you don't multiply it by1.5
, you multiply it by0.15
.Also it refers to the element it is defined, not the parent.
100%
on the child would give aline-height
value of24px
.At least it's what I'm getting on Firefox. Is it different for you?
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!
Yes and it refers to the
font-size
of the element itself. I think that for.child
to have aline-height
of24px
it should have it set to100%
.I just forgot to update the CSS 🤣.
Now it should be correct!
Thanks again! appreciated it!