Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

font-weight — font stroke weight

The font-weight property selects font weight using a number or keyword. It is inherited, and its visible effect depends on the available font.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

font-weight: normal | bold | <number [1,1000]> | bolder | lighter;

font-weight specifies glyph stroke weight. It is inherited; the initial value normal means 400, while bold means 700.

Unitless numbers from 1–1000, including fractional values, are valid. Percentages are not allowed. bolder and lighter depend on the inherited value, rather than adding or subtracting 100: from 400, they produce 700 and 100, respectively.

A missing weight is matched using the font-selection algorithm, not necessarily the numerically nearest value. Variable fonts can support a weight range; different values do not guarantee different appearances. The browser may also synthesize bolding.

The example demonstrates inheritance and relative weights. Check computed values rather than pixel equality across systems.

Examples

<!doctype html>
<meta charset="utf-8">
<title>font-weight</title>
<style>
  .sample { font-family: sans-serif; font-weight: 400; }
  .heavy { font-weight: bolder; }
  .light { font-weight: lighter; }
</style>
<p class="sample">400 <span class="heavy">700</span> <span class="light">100</span></p>

Result

400 700 100

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources