CSS font-weight Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Typography

What You’ll Learn

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.

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.

📝 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.

Basic Example

font-weight-basic.css
h1 { font-weight: 300; }
p { font-weight: bold; }
font-weight: normal; font-weight: 400; font-weight: 600; font-weight: bold;

Default Value

The default value of the font-weight property is normal, which corresponds to a font weight of 400.

Syntax Rules

  • Accepts keywords: normal, bold, bolder, and lighter.
  • Accepts numeric values from 100 (thin) to 900 (black), in steps of 100.
  • The property is inherited — child elements receive the parent's weight unless overridden.
  • The browser uses the closest available font face when the exact weight is missing.
  • Works as part of the font shorthand when included in the declaration.

⚡ Quick Reference

QuestionAnswer
Initial valuenormal (400)
Applies toAll elements
InheritedYes
Common body weight400 or normal
Common heading weight600700

💎 Property Values

ValueDescription
normalSets the font weight to normal (equivalent to 400)
boldSets the font weight to bold (equivalent to 700)
bolderSets the font weight to one level bolder than the inherited weight
lighterSets the font weight to one level lighter than the inherited weight
100 to 900Numeric values representing different levels of font weight, where 400 is normal and 700 is bold

Common numeric weights

ValueNameTypical use
300LightLarge display headings
400Regular / normalBody text
500MediumUI labels, subtle emphasis
600Semi-boldSubheadings, buttons
700BoldStrong emphasis, headings

👀 Live Preview

The same sentence at three different font weights:

font-weight: 300; Typography weight controls emphasis.
font-weight: 400; Typography weight controls emphasis.
font-weight: 700; Typography weight controls emphasis.

Examples Gallery

Change the font weight of a heading to light and a paragraph to bold — then explore numeric scales, relative weights, and UI emphasis.

🔢 Keywords & Numbers

Start with the reference example — a light heading and a bold paragraph.

Example 1 — Light Heading and Bold Paragraph

Set the heading to weight 300 and the paragraph to bold.

font-weight-basic.html
<style>
  h1 { font-weight: 300; }
  p { font-weight: bold; }
</style>

<h1>Heading with Lighter Font Weight</h1>
<p>Paragraph with Bold Font Weight</p>
Try It Yourself

How It Works

The heading uses a light numeric weight while the paragraph uses the bold keyword, which maps to 700 in most fonts.

Example 2 — Numeric Weight Scale

Compare four common numeric weights on the same text.

font-weight-numeric.css
.weight-300 { font-weight: 300; }
.weight-400 { font-weight: 400; }
.weight-600 { font-weight: 600; }
.weight-700 { font-weight: 700; }
Try It Yourself

How It Works

Higher numbers produce thicker strokes. The visible difference depends on which weights your font file actually includes.

📈 Relative & UI Emphasis

Use relative keywords and semi-bold weights for nested emphasis and interface text.

Example 3 — bolder and lighter

Make nested text one step heavier or lighter than its parent.

font-weight-relative.css
.parent { font-weight: 400; }
.parent .emphasis { font-weight: bolder; }
.parent .muted { font-weight: lighter; }
Try It Yourself

How It Works

bolder and lighter adjust relative to the inherited weight, which is helpful inside components that already set a base weight.

Example 4 — Semi-bold Button Label

Use font-weight: 600 for clear, readable button text without full bold.

font-weight-button.css
.btn {
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.55rem 1rem;
}
Try It Yourself

How It Works

Semi-bold (600) is a popular choice for buttons and navigation because it stands out without looking as heavy as 700.

♿ 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.

🖥 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 Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions
Full support
Opera All modern versions
Full support
font-weight property 99% supported

Bottom line: font-weight is universal. Load the font weights you need with @font-face or variable fonts for best results.

🎉 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.

💡 Best Practices

✅ Do

  • Use 400 for body text
  • Use 600 or 700 for headings
  • Load all weights you use via web fonts
  • Build a consistent weight scale
  • Pair with font-size for hierarchy

❌ Don’t

  • Bold entire paragraphs for emphasis
  • Assume every numeric weight exists in the font
  • Use ultra-light weights for small text
  • Rely on faux bold when real faces exist
  • Mix too many weights without a system

Key Takeaways

Knowledge Unlocked

Five things to remember about font-weight

Use these points when setting text thickness.

5
Core concepts
400 02

Default normal

Regular text.

Default
700 03

bold = 700

Strong emphasis.

Syntax
100–900 04

Numeric scale

Precise control.

Values
🔁 05

Inherited

Children inherit.

Cascade

❓ Frequently Asked Questions

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.

Practice in the Live Editor

Open the HTML editor, change font-weight values from 300 to 700, and see how text thickness affects hierarchy.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful