[jQuery] .css() px vs. em
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY
style="WORD-WRAP: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space">
<DIV dir=ltr align=left><SPAN class=293072619-06012007>> </SPAN>Firefox is
returning the value in pixels while IE6 is returning</DIV>
<DIV dir=ltr align=left><SPAN class=293072619-06012007>></SPAN> the
value in ems. Is this a bug?</DIV>
<DIV dir=ltr align=left> </DIV>
<DIV dir=ltr align=left><SPAN class=293072619-06012007><FONT face=Arial
color=#0000ff size=2>It's just IE being IE. Other browsers have getComputedStyle
which tells you the dimensions in pixels. IE has currentStyle; although that
does tell you the current style (taking the CSS cascade into effect) it returns
whatever dimensions were given in the style rule. jQuery's .css() method uses
whatever it's dealt by the browser.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=293072619-06012007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=293072619-06012007><FONT face=Arial
color=#0000ff size=2>I think I've seen IE hacks where you can put a box
around a character and then measure the box in pixels to get the font size, but
my Google-fu is weak at the moment.</FONT></SPAN></DIV></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/