font-weight property
Gets of sets the weight of the font of the object.
![]() |
Syntax
font-weight: normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
Property values
normal-
Font is normal.
bold-
Font is bold.
bolder-
Font is at least as bold as the default bold weight.
lighter-
Font is lighter than normal.
100-
Font is at least as light as the 200 weight.
200-
Font is at least as bold as the 100 weight and at least as light as the 300 weight.
300-
Font is at least as bold as the 200 weight and at least as light as the 400 weight.
400-
Font is normal.
500-
Font is at least as bold as the 400 weight and at least as light as the 600 weight.
600-
Font is at least as bold as the 500 weight and at least as light as the 700 weight.
700-
Font is bold.
800-
Font is at least as bold as the 700 weight and at least as light as the 900 weight.
900-
Font is at least as bold as the 800 weight.
CSS information
| Applies To | All elements |
|---|---|
| Media | visual |
| Inherited | 1 |
| Initial Value |
Standards information
- CSS 2.1, Section 5.2.5
Remarks
Keywords for font-weight values are mapped to specific font variations depending on the fonts that are installed on the user's computer. In many cases, the user cannot see the difference between different font-weight settings because the system chooses the closest match.
Setting the font-weight to 400 is equivalent to normal, and to 700 is equivalent to bold. An font-weight of bolder or lighter is interpreted relative to the parent object's weight. A value of bolder for text whose parent is normal sets the text to bold.
To convert these strings to numeric equivalents, use the read-only fontWeight property.
Examples
The following examples use the font-weight attribute and the font-weight property to change the font weight.
This example uses li as a selector in an embedded (global) style sheet to set the font weight to bolder.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/font-weight.htm
<style type="text/css">
li { font-weight:bolder }
</style>
This example uses inline scripting to set the font weight to bolder when an onmouseover event occurs.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/fontWeight.htm
<p style="font-size:14" onmouseover="this.style.fontWeight='bolder'">
See also
Send comments about this topic to Microsoft
Build date: 11/29/2012
