Javascript Reference
Categories: STYLE

javascript STYLE font

@March 15, 2008, 1:22 a.m.
fontFirefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 2  

Read/Write  

This is a shorthand property that lets you set one or more font-related propertiesfontFamily, fontSize, lineHeight (which must be preceded by a / symbol in this property), fontStyle, fontVariant, and fontWeightwith one assignment statement. A space-delimited list of values (in any sequence) is applied to the specific font properties for which the value is a valid type. Or, you can short-circuit these individual settings by choosing one of the default (operating-system-dependent) system fonts: caption | icon | menu | message-box | small-caption | status-bar.

 
Example
 
document.getElementById("subhead").style.font = "bolder small-caps 16pt";
 
Value

For syntax and examples of value types for font-related properties, see the respective property listing.

 
Default

None.


Powered by Linode.