W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > January to March 2005

Re: Proper font-size calculation with ems

From: Charles McCathieNevile <charles@sidar.org>
Date: Fri, 7 Jan 2005 00:19:53 -0600 (CST)
Message-ID: <64715.203.51.144.205.1105078793.squirrel@203.51.144.205>
To: "B.K. DeLong" <bkdelong@pobox.com>
Cc: "Francois Jordaan" <francois.jordaan@wheel.co.uk>, w3c-wai-ig@w3.org, "'Bailey, Bruce'" <bruce.bailey@ed.gov>, "John Foliot - WATS.ca" <foliot@wats.ca>

Hi BK. This kind of thing is probably better hunted down in one of the
CSS-specific sites.

The basic idea is that you do something like

/* the basic element has a different size */
span, li { font-size:1.1em }

/* but when it is an element that already has a changed size, don't change
it any more.
   Note that you need to collect the combinations you might have set. */

span > span, span > li, li > span, li > li { font-size:100%}

I think the common W3C stylesheets do this (ones that are applied to specs
and stuff).

cheers

Chaals

-- 
Charles McCathieNevile           charles@sidar.org
                 http://www.sidar.org

<quote who="B.K. DeLong">

>>Indeed, .76em normally renders as 12px, and not 11px as I said.
>
> I would love to take all our font sizes in
> http://ocw.mit.edu/OcwWeb/style/core.css
>
> and convert them to ems. The problem I run into is inheritance and
> nesting.
> Often times out WYSIWYG editor in our CMS will nest several bodycopy
> <span>
> elements and just make the font size smaller and smaller, were it ems. I'd
> love to figure out how to keep that from happening.
Received on Friday, 7 January 2005 06:20:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:14:19 GMT