May 4, 2011

Difference between pixel and em (px vs em)

Lots of web developer have this question what is the difference between pixel and em unit in CSS. Well it can be simply explained by a simple px to em conversion formula.

1 ÷ parent font size (px) × required pixels = em equivalent

Here is a px to em conversion table:


pxfont-sizeemequivalent* Roundedto 3dp1pxin emsNotes
110.689*0.091
120.7500.083
130.814*0.077
140.8750.071
150.938*0.067
161.0000.063Browser standard default
171.064*0.059
181.1250.056
191.188*0.053
201.2500.050
211.313*0.048
221.3750.046
231.438*0.044
241.5000.042
251.563*0.040
261.6250.039
271.688*0.037
281.7500.036
291.813*0.035
301.8750.033


No comments:

Post a Comment

Test post after a long time

i want to see the post