Availability: |
| |||||||
Property/method value type: | String primitive | |||||||
JavaScript syntax: | - | myStyle.font | ||||||
CSS syntax: | font: aStyle aVariant aWeight aSize aLineHeight aFamily font: aConstant | |||||||
Argument list: | aStyle | A font style value | ||||||
aVariant | A font variant | |||||||
aWeight | A font weight | |||||||
aSize | A font size | |||||||
aLineHeight | A line height value | |||||||
aFamily | A font family | |||||||
aConstant | A CSS font constant |
This property can be assigned with a string containing space-separated keywords and values. The values are then unpacked and assigned to individual font styling properties.
The following font styling properties are collected together into this item:
style.fontFamily
style.fontSize
style.fontStyle
style.fontVariant
style.fontWeight
style.lineHeight
Refer to the individual topics for these properties for details of the range of suitable values. For the style.font property, the values can be presented in any order since their namespaces do not collide.
As an alternative the CSS font constant values can be used to define font appearance according to a browser and platform specific macro. The following macros are supported:
caption
icon
menu
messagebox
smallcaption
statusbar
These appearance of fonts styled according to these values are not defined in any standard but they will be consistent with text presented in the appropriate contexts on the client platform.
Prev | Home | Next |
style.floatStyle | Up | style.fontFamily |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |