Set the font weight for a <p> element to "900":
The fontWeight property sets or returns how thick or thin characters in a text should be displayed.
The fontWeight property is supported in all major browsers.
Return the fontWeight property:
Set the fontWeight property:
Value | Description |
---|---|
normal | Font is normal. This is default |
lighter | Font is lighter |
bold | Font is bold |
bolder | Font is bolder |
100 200 300 400 500 600 700 800 900 |
Defines from light to bold characters. 400 is the same as normal, and 700 is the same as bold |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | normal |
---|---|
Return Value: | A String, representing the boldness of the font |
CSS Version | CSS1 |
A demonstration of possible values:
Return the font weight of a <p> element:
CSS tutorial: CSS Font
CSS reference: font-weight property
HTML DOM reference: font property