You are here: Re: Converting px to em? « HTML « IT news, forums, messages
Re: Converting px to em?

Posted by Steve Pugh on 11/22/78 11:39

Mark Parnell wrote:
> Deciding to do something for the good of humanity, John Salerno
> <johnjsal@NOSPAMgmail.com> declared in alt.html:
>
> > I know em is relative to its ancestors, but I don't
> > see how that works here.
>
> No it's not. It's always relative to the user's default font size.

No, 1em = the current font size, which may or may not be relative to
the user's default.

silly example:
body [font-size: 15pt;}
p {margin: 2em;}

"The 'em' unit is equal to the computed value of the 'font-size'
property of the element on which it is used. The exception is when 'em'
occurs in the value of the 'font-size' property itself, in which case
it refers to the font size of the parent element."
http://www.w3.org/TR/CSS21/syndata.html#length-units

Steve

 

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

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