Name

font-weight

Values:

normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500| 600 | 700 | 800 | 900 | inherit

Initial value:

normal

Applies to:

All elements.

Inherited:

Yes.

Computed value:

One of the numeric values (100, etc.) or one of the numeric values plus one of the relative values (bolder or lighter).

Description:

This property sets the font weight used in rendering an element’s text. The numeric value 400 is equivalent to the keyword normal, and 700 is equivalent to bold. Each numeric value must be at least as light as the next lowest number and at least as heavy as the next highest number. Thus, if a font has only two weights—normal and bold—then the numbers 100 through 500 will be normal, and 600 through 900 will be bold.

Examples:

b {font-weight: 700;}
strong {font-weight: bold;}
.delicate {font-weight: lighter;}

Supported by:

Firefox, Internet Explorer, Opera, Safari.

Note:

There is minimal support for the numeric keywords (100-900).

Get CSS Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.