CSS/Properties/font-weight
From W3C Wiki
< CSS | Properties
- List of Properties
- Font
- font-family
- font-style
- font-variant
- font-weight
- font-size
- font
- Font
Contents |
font-weight
The font-weight property selects the weight of the font.
Description
| Values | normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit |
|---|---|
| Initial value | normal |
| Applies to | All elements |
| Inherited | Yes |
Values
normal
Specifies normal characters.
bold
Specifies thick characters.
bolder,lighter
The 'bolder' and 'lighter' values select font weights that are relative to the weight inherited from the parent.
100to900
Specifies from thin to thick characters. The keyword 'normal' is synonymous with '400', and 'bold' is synonymous with '700'.
inherit
Takes the same specified value as the property for the element's parent.
Example
Example A
[style.css]
p#no{ font-weight: normal; }
p#b{ font-weight: bold; }
[index.html]
<body> <p id="no">This is a paragraph(normal)</p> <p id="b">This is a paragraph(bold)</p> </body>
CSS Reference
The CSS specification defines the font-style property in 15.6 Font boldness.

