In the example “Exploring an example” from : https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#lengths the element has a size of 16px.
em means “my parent element’s font-size”.
.ems li {
font-size: 1.3em;
}
This should mean that all <li>
elements inside the <ul>
with “ems” class should have 16px1.3=20.8px, but this is not the case. It’s 24.96px.
The following <li>
elements have the correct value: 24.961.3 = 32.448
32.448 * 1.3 = 42.1824
But why did it start at 24.96px?
Why not 20.8 (which is 16 * 1.3)
Alternative question:
Wouldn’t “the parent element’s font size” technically include the
-
<body>
*1.3 -
<section>
*1.3 -
<ul>
*1.3
same for the nested ul elements inside the third li?
“Three B” gets it’s value from the 2x *1.3 for each <li>
but why not for the 2x <ul>
Those are it’s parents too.
I feel like this should be super simple and I’m just overcomplicating things but I simply don’t get it right now.