Setting Font Weights

CSS provides the font-weight property for setting different font weights. The heavier a font's weight, the bolder it is displayed. The font-weight property takes four keyword values, normal, bold, bolder, and lighter, and nine numeric values, 100, 200, 300, 400, 500, 600, 700, 800, and 900.

The CSS specifications say that normal is synonymous with 400 and bold is synonymous with 700, while bolder and lighter should select font weights that are relative to the font weight inherited from the parent element.

All CSS-supporting browsers should support the bold and normal keywords, as well as the 400 and 700 numeric values. For instance, here's an example of using inline styles to set bold and normal font weights (see Figure 7.11 ...

Get Cascading Style Sheets (CSS) by Example 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.