At 3:12 PM -0800 11/28/05, Michael Hulse wrote:

>Should I be coding like so:
>
>       font: normal 76.1%/125 "Lucida Sans Unicode", verdana, helvetica,
>sans-serif;
>
>Rather than:
>
>       font: normal 76.1%/125% "Lucida Sans Unicode", verdana, helvetica,
>sans-serif;
>
>In the above example, is specifying a unit for line-height a bad thing,
>sloppy, or just a matter of individual coding preference.

    They mean two totally different things in this context. 
'line-height: 125' (which is what you're saying in the first example) 
means "a line-height that's 125 times the font-size for this 
element".  'line-height: 125%' means "a line-height that's one and 
one quarter (1.25) times the font-size for this element".
    Except for a very few properties, units are required for any 
non-zero number.  The exceptions in CSS 2.1[*] are:

    line-height (see above for the difference)
    widows (numeric values are always unitless for this property)
    orphans (numeric values are always unitless for this property)
    z-index (numeric values are always unitless for this property)

...as well as a number of aural-media properties that nobody 
supports.  Not that any browsers support 'widows' or 'orphans', 
either, the heartless jerks.  (Ba-dum-bum-ching!  Thankyew!)


[*] http://w3.org/TR/CSS21

-- 
Eric A. Meyer (http://meyerweb.com/eric/), List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
   -- Martina Kosloff (http://mako4css.com/)
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to