font-weight property is used for specifying the weight of the font. You can specify a font as being
bold, or another relevant value.
font-weight property is typically used for specifying bold text, it can also be used for specifying a particular weight of a font face. Many typefaces come in a range of weights. You can specify that the body text is displayed in a light typeface, such as
300, and article ledes are displayed in say,
500. This assumes that such weights are available for the particular font face being used.
When a weight is specified for which no face exists, a face with a nearby weight is used. In general, bold weights map to faces with heavier weights and light weights map to faces with lighter weights.
If a bold font has been specified for which there is no bold face, the user agent will usually synthesize the effect. This can be disabled with the
font to set the most common font properties in one go.
- Same as
- Same as
- Specifies a bolder weight than the inherited value.
- Specifies a lighter weight than the inherited value.
- Extra Light (Ultra Light).
- Semi Bold (Demi Bold).
- Extra Bold (Ultra Bold).
- Black (Heavy).
In addition, all CSS properties also accept the following CSS-wide keyword values as the sole component of their property value:
- Represents the value specified as the property's initial value.
- Represents the computed value of the property on the element's parent.
- This value acts as either
initial, depending on whether the property is inherited or not. In other words, it sets all properties to their parent value if they are inheritable or to their initial value if not inheritable.
- Initial Value
- Applies To
- All elements
- Yes (see example)