Felix Miata wrote:
Seems like a line-height not explicitly set for the current block ought to compute from the font-size of the current block instead of inheriting from some ancestor

Not per the CSS spec...


neither font-size nor line-height for H1 were explicit

font-size is explicitly set (in the UA stylesheet). line-height is inherited. Simple testcase:


<body style="font-size: 10px; line-height: 1.5em">
  <div style="font-size: 30px">Text</div>
</body>

Per the CSS spec the computed line-height of the <div> is 15px, since the absolute value is inherited. This is the major difference between "line-height: 1.5" and "line-height: 1.5em" (which lead to the same computed line-height on the <body> but to totally different line-heights on the kids).

This looks like a simple authoring error to me; a number should be used for the line-height, not a length, unless you really want to clobber it for all descendants.

As for why it works, that way, consider:

<body style="font-size: 10px; line-height: 10x">
  <p> p1 </p>
  <p> p2 </p>
  <p> p3 </p>
</body>

The line-height of each <p> should be 10px, no? How to express that in CSS?

-Boris
_______________________________________________
mozilla-layout mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-layout

Reply via email to