CSS font-weight Property
Sets the boldness of the font
Syntax
font-weight: normal | bold | bolder | lighter | <number>;Values
| Value | Description |
|---|---|
| normal | Equivalent to 400 |
| bold | Equivalent to 700 |
| 100-900 | Numeric weight values |
| bolder | One weight bolder than parent |
| lighter | One weight lighter than parent |
Example
.heading {
font-weight: 700;
}
.light-text {
font-weight: 300;
}Understanding CSS font-weight
The CSS font-weight property sets the boldness of the font. As part of the Typography module in CSS, it is one of the most commonly used properties for controlling the visual presentation of web pages.
You can set font-weight to values such as normal, bold, 100-900, bolder, among others. Each value changes how the browser renders the affected element, giving you fine-grained control over your page layout and design. Choosing the right value depends on the specific design requirements of your project.
Common use cases for the font-weight property include responsive web design, component-based layouts, and creating visually consistent interfaces across devices. It works closely with related properties like font, font-family, font-style to achieve complex styling effects. Understanding how these properties interact helps you write cleaner, more maintainable stylesheets.
Browser support for font-weight is excellent across all modern browsers including Chrome, Firefox, Safari, and Edge. For older browsers, consider using fallback values or progressive enhancement strategies. The property can also be set dynamically via JavaScript using element.style.fontWeight or the CSS custom properties (variables) approach for theming.
Related Properties
fontShorthand for font-style, font-variant, font-weight, font-stretch, font-size, line-height, and font-family
font-familySpecifies a prioritized list of font family names for the selected element
font-styleSets whether a font should be styled as normal, italic, or oblique
font-sizeSets the size of the font for text content
Explore More CSS Properties
Browse our complete reference of 251 CSS properties with syntax, examples, and tips.