40 PX to EM

Result

40 px = 2.5 em


Explanation

  • Base — 16
  • EM — 2.5

To convert 40 pixels to EM with base 16 you need to divide pixels value by base value, in our case: 40 / 16. In result we'll receive that 40 pixels with base 16 is equal to 2.5 em

CSS code for 40 PX to EM

p { font-size: 2.5em }

HTML (inline CSS):

<p style="font-size: 2.5em">Hello World<p>
Open PX to EM converter