What you can do is set the size of the base font (the font-size property in the <body> element) to about 62.8% (some say 62.5%):
<body style="font-size:62.5%;">
This makes the base font, or 1.0em, approximately equal to 10px. This is not accurate, and varies from font to font, but, generally speaking, it is quite accurate. By doing this, you can use EM and their pixel equivalents:
1.0em = 10px, 1.1em = 11px, 1.2em = 12px, etc.
This way you can easily convert from pixels to EM by dividing by 10:
var ems = parseInt($(".bogus").css("padding-left")) / 10;
karim79
source share