The font-weight property controls how thick or bold text looks, helping you build clear hierarchy and emphasis across your site.
01
normal
Weight 400.
02
bold
Weight 700.
03
100–900
Numeric scale.
04
lighter
Relative down.
05
bolder
Relative up.
06
Hierarchy
Headings vs body.
Fundamentals
Introduction
The font-weight property in CSS is used to set the weight (or boldness) of the font. This property allows web developers to adjust the thickness of the text, enhancing readability and emphasizing important content.
The font-weight property is versatile and can be applied to headings, paragraphs, and other text elements to achieve various design effects.
Definition and Usage
Use keyword values like normal and bold for simple styling, or numeric values from 100 to 900 for precise control in design systems. Variable fonts can interpolate smoothly between weights when the font supports it.
💡
Beginner Tip
Think of font weight as a scale: 400 is regular body text, 600–700 is semi-bold to bold for headings and emphasis, and 300 or lower is light for large display titles.
Foundation
📝 Syntax
The syntax for the font-weight property is straightforward. It can be applied to any text-containing element:
syntax.css
element{font-weight:value;}
Here, value can be one of several predefined keywords or numeric values that correspond to different font weights.
Semi-bold (600) is a popular choice for buttons and navigation because it stands out without looking as heavy as 700.
A11y
♿ Accessibility
Do not rely on weight alone to convey critical information; combine with color, icons, or wording when needed.
Maintain readable contrast at every weight, especially light text on light backgrounds.
Use semantic HTML — prefer <strong> for important content; it typically renders bold by default.
Avoid very thin weights (100–200) for small body text; they can be hard to read.
Test at high zoom to ensure bold and light text remain legible.
🧠 How font-weight Works
1
You set a weight value
Choose a keyword like bold or a number like 600.
Declaration
2
Browser selects a face
It picks the closest matching weight from the font family, or synthesizes bold if needed.
Font matching
3
Text renders thicker or thinner
Stroke thickness changes while font-family and font-size stay the same.
Rendering
=
💪
Clear visual hierarchy
Headings, body copy, and emphasis each appear at an appropriate thickness.
Compatibility
🖥 Browser Compatibility
The font-weight property is well-supported across all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. This ensures consistent rendering of text weight on different devices and platforms.
✓ Baseline · Universal support
font-weight everywhere
Keywords and numeric values work in every major browser, including legacy environments.
99%Universal support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions
Full support
OperaAll modern versions
Full support
font-weight property99% supported
Bottom line:font-weight is universal. Load the font weights you need with @font-face or variable fonts for best results.
Wrap Up
🎉 Conclusion
The font-weight property is an essential tool for web developers aiming to enhance text readability and emphasize important content. By adjusting the weight of the font, you can create a more engaging and visually appealing website.
Experiment with different font weights to see how they can improve the overall design and user experience of your web projects. Build a simple scale with 400 for body, 600 for UI, and 700 for strong emphasis.
The font-weight property sets how thick or bold text appears by choosing a weight from the active font family, such as normal, bold, or a numeric value from 100 to 900.
The default value is normal, which typically corresponds to a font weight of 400.
bold is a keyword that usually maps to 700. In most cases they produce the same result, but 700 gives you explicit numeric control in design systems.
bold sets a fixed weight near 700. bolder makes text one step heavier than the inherited weight, which is useful for nested emphasis.
The font must include a 500 (medium) face. If only 400 and 700 exist, the browser picks the closest available weight and the change may be subtle or invisible.