document.classes.fontWeight

JavaScript 1.2+ Nav4+ Syntax

document.classes.className.tagName.fontWeight

Description

The fontWeight property specifies the font weight used by an element when associated with the class called className. The definition can also specify a tag or the word all for tagName.

The fontWeight property can be assigned one of the following values: normal, bold, bolder, lighter, or a number from 100 to 900.

Example

Listing 7.76 uses the fontWeight property to set different levels of weight on various text. Even though the fontWeight can be set from 100 to 900, this does not mean that there are 800 different font weights. In Listing 7.76, you will find that fontWeight 400 looks the same as fontWeight 100.

Listing ...

Get Pure JavaScript 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.