Javascript Reference
Categories: STYLE

javascript STYLE fontWeight

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

Read/Write  

Sets the weight (boldness) of the element's font. CSS provides a weight rating scheme that is more granular than most browsers render on the screen, but the finely tuned weights may come into play when the content is sent to a printer. The scale is a numeric rating from 100 to 900 at 100-unit increments. Therefore, a fontWeight of 100 would be the least bold that would be displayed, while 900 would be the boldest. A setting of normal (the default weight for any font) is equivalent to a fontWeight value of 400; the standard bold setting is equivalent to 700. Other settings (bolder and lighter) let you specify a weight relative to the parent element's weight.

 
Example
 
document.getElementById("hotStuff").style.fontWeight = "bold";
 
Value

Any of the following constant values: bold | bolder | lighter | normal | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900.

 
Default

normal


Powered by Linode.