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

Re: Proper font-size calculation with ems (was RE: Image Galleries)

From: Patrick H. Lauke <redux@splintered.co.uk>
Date: Wed, 05 Jan 2005 14:45:07 +0000
Message-ID: <41DBFD73.4090804@splintered.co.uk>
To: w3c-wai-ig@w3.org
CC: "John Foliot - WATS.ca" <foliot@wats.ca>

B.K. DeLong wrote:

> 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. 

It's not just a case of changing any px references to ems. You need to 
have a good look at the CSS and your typical page structure and let 
inheritance work *for* you, rather than against you. E.g.: not studied 
your CSS in any detail, but there are a lot of font-size:11px rules 
there. If you wanted to change to ems, you wouldn't replace all those 
with font-size:0.75em (as yes, that would get you into inheritance 
problems), but rather set the font-size for the entire page (on the body 
element) to 0.75em and remove any further size declarations for all the 
elements, classes, etc that are to be displayed at this default size. To 
sum it up in a few words: you want to set the font size at the highest 
possible level within the document tree.

Hope that makes some kind of sense...
Patrick H. Lauke
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
Received on Wednesday, 5 January 2005 14:44:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 October 2015 16:21:30 UTC