get font size in pixels - IE

N

nutso fasst

window.getComputedStyle() is no good in MSIE. Is there a way to determine
the pixel size of the default (or user-specified) font for BODY in IE?

Thanks,
nf
 
M

Michael Winter

window.getComputedStyle() is no good in MSIE. Is there a way to
determine the pixel size of the default (or user-specified) font for
BODY in IE?

objRef.currentStyle.<property>

gives you the equivalent. However, why do you need to know the font size?
Just use em units where 1em equals the height of the font.

Mike
 
N

nutso fasst

objRef.currentStyle. said:
gives you the equivalent. However, why do you need to know the font size?
Just use em units where 1em equals the height of the font.

Given the font size in pixels it is possible to emulate the max-width
property in ems in MSIE 5-6. That's what I want to do. It's possible to
emulate max-width for the general case of 96 pixels/inch display and 12pt
default font size (www.svendtofte.com/code/max_width_in_ie/), but I was
hoping to do better. Maybe the numerical value could be separated from the
units in the fontSize property, multiplied by max-width in ems, then
appended with original units as the max-width property, but since it's
possible font-size might be "medium" or "90%" or "larger" on a user's
stylesheet, that won't work in all cases.

nf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top