CSS Reference ยท Typography
The font-weight property
Reference for the CSS font-weight property: normal, bold, bolder, lighter and numeric 1 to 1000 values, how weights map to font faces, with live examples.
The font-weight property sets how heavy the glyphs are. The keyword normal is 400 and bold is 700; numbers from 1 to 1000 allow finer steps. Headings, <strong>, <b> and table headers are bold by default.
The browser looks for the closest face the font family provides. Most fonts ship only regular and bold, so many numeric values look the same unless the family has more weights or is a variable font.
h2 { font-weight: 600; } .note { font-weight: lighter; }
Try it
The number of visibly different lines depends on the font. If several lines look identical, the font has fewer weights than you asked for.
Syntax
font-weight: normal | bold | bolder | lighter | <number [1,1000]>;
| Initial value | normal |
| Applies to | All elements and text |
| Inherited | Yes |
| Animatable | Yes (as a number) |
| Computed value | A number, except bolder and lighter, which are computed against the parent's weight |
Values
| Value | Description |
|---|---|
normal |
Same as 400. |
bold |
Same as 700. |
bolder |
One step heavier than the parent's weight (400 becomes 700, 700 becomes 900). |
lighter |
One step lighter than the parent's weight (400 becomes 100, 700 becomes 400). |
1โ1000 |
Any number. Variable fonts can use every value; static fonts snap to the nearest available face. |
Usage notes
- Unitless numbers. Write
font-weight: 600, not600pxor"600". - Matching rules. For 400 and 500 the browser checks a few neighbours first; for heavier values it prefers the next heavier face, and for lighter values the next lighter one. That is why 600 often renders as bold.
- Web fonts. Declare the weight (or a range such as
100 900for variable fonts) in@font-faceso the browser maps weights to files correctly. Otherwise it may fake bold, seefont-synthesis. - Meaning. Use
<strong>for important text and CSS for visual weight only; do not simulate headings with bold paragraphs. - Readability. Very thin weights (100 to 200) are hard to read at small sizes or on low-contrast backgrounds.
- Animating. Weights animate smoothly only with a variable font. With static fonts the text jumps between faces and can reflow.
Browser support
Keywords and the values 100 to 900 work everywhere; arbitrary numbers from 1 to 1000 need a modern browser and are most useful with variable fonts.
Related
font-styleโ italic and obliquefont-stretchโ width of the facefont-variation-settingsโ the wght axisfont-synthesisโ synthesized bold- Lessons: Fonts, Web fonts