CSS font-weight Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The font-weight property sets how light or bold text looks. The weights you can see depend on the active font-family.

The initial value is normal (same as 400). The property is inherited and applies to all elements and text, including ::first-letter and ::first-line. It is also part of the font shorthand.

Standard-track.

Not deprecated and not experimental. Keywords and classic numeric weights are Baseline Widely available. Fine-grain numbers from 1 to 1000 are mainly useful with variable fonts.

CSS Syntax

syntax.css
font-weight: normal | bold | 100–900 | lighter | bolder | initial | inherit;

normal equals 400. bold equals 700. Relative keywords step from the parent weight.

Property Values

ValueDescriptionTry it
normalRegular weight. Same as 400. Initial valueTry it
boldBold weight. Same as 700Try it
100–900Numeric weights. Higher numbers are heavierTry it
bolderOne relative step heavier than the parentTry it
lighterOne relative step lighter than the parentTry it
initialResets to normalTry it
inheritTakes the parent’s font-weightTry it

Common names map roughly as 100 Thin, 400 Regular, 700 Bold, and 900 Black.

How to Use font-weight

Pick a keyword or number, then confirm the font includes that face.

  1. Choose the text that should look lighter or heavier.
  2. Set font-weight to bold, normal, or a number such as 600.
  3. Use a font-family that ships the weight you request when exact results matter.
  4. Prefer bolder / lighter only when the child should step from the parent’s weight.
PieceRequired?Role
Weight valueYesKeyword or number that sets boldness
Font facesFor exact looksMissing faces fall back to the closest available weight
ContrastBest practiceVery thin weights can be hard to read

Live Preview

Only font-weight changes. Compare the same sentence at different weights.

Your system font may only include a few faces. Unavailable weights fall back to the closest one.

Sample

Css Font Weight Sample

font-weight: bold

CSS Examples

Each snippet focuses on font-weight only. Use Try It Yourself for a live editor.

Example 1 — Bold Keyword

Make a paragraph bold with the classic keyword.

CSS
<style>
  p {
    font-weight: bold;
  }
</style>

<p>Css Font Weight Sample</p>
Try It Yourself

How It Works

  1. Set the keyword. font-weight: bold asks for a heavy face.
  2. Map to a number. bold is the same idea as 700.
  3. See the stroke thicken. Letters look darker and heavier than normal.
  4. Use for emphasis. Headings and strong labels often use bold.

Example 2 — Numeric Weight

Use a number when you want an explicit weight such as light text.

CSS
<style>
  p {
    font-weight: 300;
  }
</style>

<p>Css Font Weight Sample</p>
Try It Yourself

How It Works

  1. Pick a number. 300 is commonly called Light.
  2. Compare with bold. The stroke is thinner than 700.
  3. Check the font. If Light is missing, the browser falls back to the closest face.
  4. Design systems. Numbers make scales such as 400 / 600 / 700 easy to document.

Example 3 — Relative Bolder

Make a child one step heavier than its parent.

CSS
<style>
  div {
    font-weight: normal;
  }

  strong {
    font-weight: bolder;
  }
</style>

<div>Normal text with <strong>bolder emphasis</strong></div>
Try It Yourself

How It Works

  1. Set the parent. The div starts at normal (400).
  2. Step up once. bolder on the child moves to the next relative heavy step, usually 700.
  3. Depend on inheritance. If the parent were already bold, bolder would climb toward 900.
  4. Prefer fixed weights for UI kits. Use 700 when you need the same boldness everywhere.

Edge Cases & Pitfalls

If the weight looks wrong, check the font faces first.

faces

Missing weights fall back

If you ask for 500 and the family only has 400 and 700, the browser picks the closest available face. The computed value still stays what you wrote.

a11y

Very thin text is hard to read

100 and 200 can be difficult for people with low vision, especially with low contrast. Prefer at least regular weight for body copy.

rel

bolder and lighter are relative

They step from the parent using a simplified scale (about 100 / 400 / 700 / 900). Nested relative weights can climb or drop faster than you expect.

short

The font shorthand can overwrite weight

Writing font after font-weight resets weight unless you include it in the shorthand.

var

Variable fonts unlock fine numbers

Values between classic hundreds, or the full 1–1000 range, shine with variable fonts that expose a wght axis. Static fonts still snap to available faces.

Browser Support

font-weight is a browser CSS property for typography. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

font-weight

Supported in all modern browsers and Internet Explorer. Keywords and numeric weights are long-established.

99% Global support
Google Chrome 2+
Full support
Mozilla Firefox 1+
Full support
Apple Safari 1+
Full support
Microsoft Edge 12+
Full support
Opera 3.5+
Full support
Samsung Internet 1+
Full support
Internet Explorer 3+
Full support
font-weight Widely supported

Bottom line: Safe everywhere for normal, bold, and classic numeric weights. Fine-grain variable-font weights need modern browsers and a matching font file.

Key Takeaways

  • Role: set how light or bold the text looks.
  • Map: normal = 400, bold = 700.
  • Inherited: yes. Initial value is normal.
  • Font faces matter: unavailable weights fall back to the closest face.

One line: font-weight chooses the boldness of the text; the font family decides which faces you can actually see.

Frequently Asked Questions

It sets how light or bold text looks. You can use keywords such as normal and bold, numbers such as 400 and 700, or relative keywords lighter and bolder.
The initial value is normal, which maps to 400.
Yes in practice. bold is a keyword that equals 700. normal equals 400.
The active font may not include a 500 face. The browser then picks the closest available weight, so the change can look subtle or invisible.
bold always targets about 700. bolder makes the element one relative step heavier than its parent, so the result depends on the inherited weight.
It is Baseline Widely available and works in all modern browsers and Internet Explorer. It is a browser CSS property, not a Node.js, Deno, or Bun feature.

Next: gap

Set spacing between flex or grid items.

gap tutorial →

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.

8 people found this page helpful