https://bugzilla.wikimedia.org/show_bug.cgi?id=17297





--- Comment #3 from Philippe Verdy <[email protected]>  2009-09-30 07:12:03 
UTC ---
I forgot to comment the change also from "line-height:1.2em" to
"line-height:1.2".

It is less critical because it is not flagged with "!important", so it can
effectively be overriden in other stylesheets, both when printing or viewing on
screen (Monobooks.css, chick.css, and custom per-site stylesheets, or user's
own stylesheets in their own /Monobook.css subpage of their user page space).

But anyway you should know that the difference is documented by W3.org (and
very well respected by browsers): specifiying the line-height in a block
element or inline element with an absolute unit (in, pt, cm, mm) or even with a
unit relative to the font-size (em, ex, %) has the severe defects that this
does not affect the line-height in subelements (it is NOT inherited, notably
when the font size is changed) :

so if you have indices or exponents that set their own font-size, these
font-sizes will continue to use the same computed line-height, even if they can
then be shown partially over the previous or next line (depending on their
background and clipping styles, they may be truncated, or could hide parts of
these other lines). The same is true when you'll have multiple scripts on the
same line, and that use different fonts: when changing font, the line-height
will not be adjusted correctly, if those change do not also set again their
local line-height.

The same is true when you have bigger fonts or when you use <big> or <small>:
their line-height is not adjusted as they should, because the paragraph's
line-height is NOT inherited in its given relative size but in its COMPUTED
absolute size. So the larger characters will overlay the previous or next line
in the same paragraph, or even the previous or next paragraphs...

Instead, drop the relative unit "em" and you'll get the same computed size,
except that it will be inherited as a multiplier for the font-size, even if it
is changed. I've NEVER seen any use of the unit "em" in line-height that is
effectively justified (and the other font-size relative unit "ex" is also
stupid and has no use for the line-height.)

The only case where you MAY need a unit, is when you set it using an ABSOLUTE
unit (generally in "pt", but could be also "in", "cm", "mm" or "px"), provided
that the font-size is also set using the same absolute unit (notably in "pt"),
but you should still be aware that the line-height will not be inherited in its
relative setting, but only in its computed absolute size (in "px", or "mm" or
"pt") independantly of the font-size that gets set later within the content: in
general, you would set this absolute line-height in points at the same location
where you set the font-size with an absolute unit in points.

On Wikimedia sites, for which accessibility should be a rule of thumb, an
absolute font-size setting should not be used within articles, so an absolute
line-height should not be used as well, but it MAY be set at the global page
level by the font-size for the whole content of the page (it should be set ONLY
for the <body> element or the element with id "content").

In other words, DO NOT specify any unit for the line-height for elements (like
p) that can be used at unpredicted random locations in the document. Use ONLY
"font-size:"-relative size WITHOUT any unit (it will be correctly inherited as
a multiplier of the current font-size, even if it changes later).


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to