Quote:
Originally Posted by DrChiper
ehh, I indicated the "margin" setting (not font), which is nowhere changed but differs in the computed final style.
|
It's the very same situation despite margin, font-size or whatever other property.
"em" measure units are relative. As example 4em means "4 times whatever base size you have". Because of that, in the end you need to convert them to "absolute" sizes. And that is what you are getting. The computed final size cannot be "em", it must be pixels.
And remember that they are applied in cascade when inherited, they are NOT overridden in this case. If your base size is 15 pixels, your body is 2em and your h1 is 3em, you end with h1 being 90 pixels (15 x 2 x 3), not 45 pixels (15 x 3).
But matched rules are still overridden. If h1 is still 3em but h1.myclass is 4em, you will end with 15 x 2 (from body) x 4 (from .myclass) = 120 pixels. 3em is not applied any more.