CSS font-weight
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The font-weight
CSS property sets the weight or boldness of the font.
The following table summarizes the usages context and the version history of this property.
Default value: | normal |
---|---|
Applies to: | All elements |
Inherited: | Yes |
Animatable: | Yes. See animatable properties. |
Version: | CSS 1, 2, 3 |
Syntax
The syntax of the property is given with:
The example below shows the font-weight
property in action.
Example
Try this code »h1 {
font-weight: normal;
}
p {
font-weight: bold;
}
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
normal |
Specifies normal characters. |
bold |
Specifies thick characters. |
bolder |
Selects a font weight that's bolder than the weight inherited from the parent. |
lighter |
Selects a font weight that's lighter than the weight inherited from the parent. |
100 |
The numeric values The keyword |
200 |
|
300 |
|
400 |
|
500 |
|
600 |
|
700 |
|
800 |
|
900 |
|
initial |
Sets this property to its default value. |
inherit |
If specified, the associated element takes the computed value of its parent element font-weight property. |
Browser Compatibility
The font-weight
property is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: CSS Fonts, CSS Text.
Related properties and at-rules: font
, font-style
, font-variant
, font-size
, line-height
, font-family
, @font-face
.