O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

font-weight

Values:

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

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:

Defines 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. If a font has only two weights—normal and bold—the numbers 100 through 500 will be normal, and 600 through 900 will be bold. In general terms, the visual result of each numeric value must be at least as light as the next lowest number and at least as heavy as the next highest number.

Examples:

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required