font-weight

The font-weight CSS property specifies the weight or boldness of the font. However, some fonts are not available in all weights; some are available only on normal and bold.

Values

normal
Normal font weight. Same as 400.
bold
Bold font weight. Same as 700.
lighter
One font weight lighter than the parent element (among the available weights of the font).
bolder
One font weight darker than the parent element (among the available weights of the font).
100, 200, 300, 400, 500, 600, 700, 800, 900
Numeric font weights for fonts that provide more than just normal and bold. If the exact weight given is unavailable, then 600-900 use the closest available darker weight (or, if there is none, the closest available lighter weight), and 100-500 use the closest available lighter weight (or, if there is none, the closest available darker weight). This means that for fonts that provide only normal and bold, 100-500 are normal, and 600-900 are bold.

Interpolation

A font-weight value is interpolated via discrete steps (multiples of 100). The interpolation happens in real number space and is converted to an integer by rounding to the nearest multiple of 100, with values halfway between multiples of 100 rounded towards positive infinity.

<!DOCTYPE html>
<html>
    <head>
        <style>
            p.normal {
                font-weight: 400;
            }
            
            p.heavy {
                font-weight: 700;
            }
            
            h1.lighter {
                font-weight: lighter;
            }
            
            h1.bolder {
                font-weight: bolder;
            }
        </style>
    </head>
    <body>
        <p class="normal">
            This is a 400 weight paragraph.
        </p>
        <p class="heavy">
            Now, compare to a 700 weight paragraph.
        </p>
        <h1 class="lighter">A light header</h1>
        <h1 class="bolder">And now bolder</h1>
    </body>
</html>