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:
1 ÷ parent font size (px) × required pixels = em equivalent
Here is a px to em conversion table:
| pxfont-size | emequivalent | * Roundedto 3dp | 1pxin ems | Notes |
|---|---|---|---|---|
| 11 | 0.689 | * | 0.091 | |
| 12 | 0.750 | 0.083 | ||
| 13 | 0.814 | * | 0.077 | |
| 14 | 0.875 | 0.071 | ||
| 15 | 0.938 | * | 0.067 | |
| 16 | 1.000 | 0.063 | Browser standard default | |
| 17 | 1.064 | * | 0.059 | |
| 18 | 1.125 | 0.056 | ||
| 19 | 1.188 | * | 0.053 | |
| 20 | 1.250 | 0.050 | ||
| 21 | 1.313 | * | 0.048 | |
| 22 | 1.375 | 0.046 | ||
| 23 | 1.438 | * | 0.044 | |
| 24 | 1.500 | 0.042 | ||
| 25 | 1.563 | * | 0.040 | |
| 26 | 1.625 | 0.039 | ||
| 27 | 1.688 | * | 0.037 | |
| 28 | 1.750 | 0.036 | ||
| 29 | 1.813 | * | 0.035 | |
| 30 | 1.875 | 0.033 |
No comments:
Post a Comment