CSS line-height is not inherited properly except in P

RESOLVED INVALID

Status

()

RESOLVED INVALID
15 years ago
15 years ago

People

(Reporter: something-bz, Unassigned)

Tracking

Trunk
PowerPC
macOS
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.7
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040531 Firefox/0.8.0+

When line-height is specified with font-size, results are as predicted. When line-height is inherited, it 
uses the line height calculated previously. This means if a document specifies a default line-height and 
then changes it in a <div> or <TH>, it looks wrong.

This renders predictably:
<div style="line-height: 1.1em; font-size: 3em;">A<BR>B<BR>C</div>

This does not:
<div style="line-height: 1.1em;"><div style="font-size: 3em;">A<BR>B<BR>C</div></div>

Enclosing the text in <P></P> instead works properly, but this is not suitable for tables since it leaves 
huge spaces before and after the paragraph (the table in question uses line-height: 1.5 em).

Adding line-height to every <TD> and <TH> is not suitable, since it's a function of the style sheet and, 
if anything, should be inherited correctly. line-height is not inherited properly anyway, since BODY { 
line-height: 2 em } doesn't change the spacing in the table, but TD { line-height: 2 em } does (unless 
TD doesn't inherit line-height, which means it should make the row taller to accomodate font-size)).

Also verified on Windows Mozilla (not the latest version though).

Reproducible: Always
Steps to Reproduce:
1. View the related URL (and the table in http://en.wikipedia.org/wiki/Quotation_mark#Straight_quotes 
)
It's pretty clear in the spec that what we do is right.  You generally want to
use numbers for line-heights rather than lengths.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → INVALID
(The site stylesheet has a 'line-height: 1.5em' in rules matching both #content
(which matters here) and p (which doesn't).)
(Reporter)

Comment 3

15 years ago
(In reply to comment #1)
> It's pretty clear in the spec that what we do is right.  You generally want to
> use numbers for line-heights rather than lengths.

Where does it say that?
You need to log in before you can comment on or make changes to this bug.