Hacker News new | past | comments | ask | show | jobs | submit login

Not everything - this article is wrong that CSS defines em as being based on "m" [1] (includes actual quote [2] from w3c spec)

[1] http://stackoverflow.com/a/4531441/1971539

[2] 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. It may be used for vertical or horizontal measurement.




I'm the author of the article (the reponse not the original). I didn't say em is based on "m". All I said about em is:

"(For completeness, I should mention here that the "em" and "ex" units are exceptions to the above. The lengths 1em and 1ex do vary relative to the other units, because they depend on the font in use.)"

I'll update this to say "font size" as I didn't mean to give the impression that it was dependent the choice of font.


I was nit picking to be fair. But font size certainly does clear up the ambiguity.




Consider applying for YC's first-ever Fall batch! Applications are open till Aug 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: