What is the font-weight property in CSS?
The font-weight property is meant for setting the weight (boldness) of the font. The default font-weight is set as normal. Other values that can be used for font-weight are:
bold: makes the text bold by setting its font-weight value to .- Numerical values in the range of : These values represent the amount of weight we intend to assign to the text, where is the maximum weight.
bolder/lighter: makes the font-weight one weightbolderorlighterthan its current value.
Implementation
The following code sets different a font-weight for each line of the text:
Free Resources
Copyright ©2026 Educative, Inc. All rights reserved