W3C home > Mailing lists > Public > www-style@w3.org > July 2001

Re: Using em in CSS

From: todd fahrner <fahrner@pobox.com>
Date: Sun, 1 Jul 2001 22:41:31 -0700
Message-Id: <200107020541.f625fwF03168@dot.dreamhost.com>
To: www-style@w3.org
On Sunday, July 1, 2001, at 09:15 , Mjumbe Ukweli wrote:

> an 'em' in any given element is relative to the font-size of the 
> element's parent.

for font-size, that's true. for other properties like margins or border 
widths, em is relative to the font-size of the selected element, not its 

Kim's confusion stems from the common misstatement that ems are relative 
to the user-chosen font-size, and from the bug in many (but not all) 
browsers in which font sizes do not inherit per spec into table 
elements. this and many other CSS bugs have been fixed in WinIE6, but 
only if you use the right sort of DOCTYPE. See 
<http://gutfeldt.ch/matthias/articles/doctypeswitch.html> for details.

> i think there needs to be a relative font measurement that is not 
> relative to the parent's font-size but to the media's default font-size.

there is, sort of: the font size keywords. CSS does not define default 
font sizes for various media, but there is the font-size keyword system 
(xx-small - xx-large), whose initial value is explicitly given as 
"medium". WAI documents explicitly associate this with the value chosen 
by the user 
WinIE, however, implements "small" as the value chosen by the user (even 
though it is called "medium" in the UI - confused yet?). I wrote a 
usenet post that got turned into an article about how to work around 
this and other bugs and use the font-size keyword system in 2001 
more-or-less as designed in 1995-6: 
Received on Monday, 2 July 2001 01:42:01 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:58 UTC