Previous Message
Next Message

Re: [css-d] understanding scaling factors for % and EM

Sent by Eric A. Meyer on 30 September 2002 16:04


At 23:17 -0500 9/29/02, John A. Lewis wrote:
>Hello Timothy,
>Sunday, September 29, 2002, 9:27:19 PM, you wrote:
>
>>  I seem to recall someone (Eric?) awhile back saying that EM is not
>>  exactly %, i.e. .8em ~= 80%
>
>I'm sure em and % have differences; I just don't know what they are.

    In terms of font size, ems and percentages act exactly the same. 
The only difference is in the way they're expressed-- sort of like 
the difference between 1000 meters and a kilometer, if you see what I 
mean.
    So the following two rules are exactly equivalent:

    p {font-size: 0.8em;}
    p {font-size: 80%;}

...and if I ever said differently, I must have been smoking crack.  A 
lot of it.
    Now, there may be differences in how browsers deal with ems and/or 
percentages, especially really old ones like IE3.  That I won't try 
to deny, as there are some brain cells in the far back of my skull 
that seem to hold a dim memory of such things.  In any halfway decent 
CSS-supporting browser, though, there should be no difference at all.

--
Eric A. Meyer (http://www.meyerweb.com/eric/), List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
   -- Martina Kosloff (http://www.mako4css.com/)
Previous Message
Next Message

Message thread: