CSS fonts and javascript
Posted: Thu Nov 27, 2008 7:39 am
Hi!
I'm stuck...
How can I get the font of an HTML element?
I've looked at the styles for elements to see what's what and found these properties relevent to fonts.
font,fontFamily,fontSize,fontSizeAdjust,fontStretch,fontStyle,fontVariant,fontWeight
Now fontFamily returns a value - which I would expect as in css thats how you define the font to be used. But what exactly does it mean?
I thought that fontFamily was just a group of fonts listed in the order that they should be used. I'm working on something which produces xml files in MS Excel 2003 xmlss format and the styles have a fontname property as well as a font family property. I've tried to understand the difference by reading various articles but i dont get it.
Can anybody explain what the difference is between a font and a font-family.
Also using javascript how would i get the FONT name? Will I have to retreive the fontFamily and parse the string?
Thanks
Joe
Thanks
I'm stuck...
How can I get the font of an HTML element?
I've looked at the styles for elements to see what's what and found these properties relevent to fonts.
font,fontFamily,fontSize,fontSizeAdjust,fontStretch,fontStyle,fontVariant,fontWeight
Now fontFamily returns a value - which I would expect as in css thats how you define the font to be used. But what exactly does it mean?
I thought that fontFamily was just a group of fonts listed in the order that they should be used. I'm working on something which produces xml files in MS Excel 2003 xmlss format and the styles have a fontname property as well as a font family property. I've tried to understand the difference by reading various articles but i dont get it.
Can anybody explain what the difference is between a font and a font-family.
Also using javascript how would i get the FONT name? Will I have to retreive the fontFamily and parse the string?
Thanks
Joe
Thanks