John J. Barton wrote:
No, this is how CSS works in general. Properties that inherit by default only get the inherited value if they're not explicitly specified.

Or to say this slightly differently: properties of this type inherit first, then are overridden by explicit values.

OK.  You could view it that way, sure (but see below).

Properties that don't inherit by default (e.g. display) get the default value if not explicitly specified.

So properties of this type default first, then are overridden by explicit values.

Sure.

All of that makes sense to me. But not the font-size.

 >>> font-size does inherit by default, but only by default.

Sorry I don't get the distinction. The spec says
    yes, the computed value is inherited,
    refer to parent element's font size

So I guess: font-size inherits actual (not CSS-style-specification) font-size of parent then overridden by explicit values?

Inheritance is always inheritance of the computed value, not the specified value. This is true whether inheritance is happening by default or because someone set a property to "inherit" explicitly. Consider the following situation:

  <div style="font-size: 20px">
    <p style="font-size: 2em"><span>Text</span></p>
  </div>

The computed font-size of the <p> is 40px, and that's the font-size the <span> inherits. "Text" ends up in a 40px font. If the specified value inherited, you'd end up with 80px text, which is not desirable.

In your original case the thing that would be inherited is a length equal to 36px.

-Boris
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to