You are here: Re: Pixel to Em conversion... « HTML « IT news, forums, messages
Re: Pixel to Em conversion...

Posted by Toby A Inkster on 05/30/07 09:35

Ben C wrote:

> Technically it's a measure of width (of an 'M') rather than of height.

In traditional typography, yes. But the modern definition of an 'em' is
that an em is the same as the font height.

The font height itself is quite a wishy-washy concept, but it can normally
be thought of as the height of most capital letters and lower-case letters
with ascenders (e.g. 'b', 'd', 'f', etc.). However, in certain fonts, some
of these letters may be smaller or taller than the font-height.

The CSS spec says that browsers are supposed to use the 1 em = font height
definition. So when using, say, a 13 px font, 1 em is supposed to be 13 px,
and doesn't depend at all on the width of the capital M, which could be
slightly larger or smaller than 13 px. The font may not even *have* a
capital letter M -- it may only have, say, Japanese Katakana characters
and no Western characters at all!

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 95 days, 17:14.]

Non-Intuitive Surnames
http://tobyinkster.co.uk/blog/2007/05/25/non-intuitive-surnames/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация